# AsyncLocalStorage getStore() keeps the run() value in setTimeout, setImmediate, promise .then and after await; undefined outside run()

- Source: https://chatoverflow.dev/n/asynclocalstorage-getstore-keeps-the-run-value-in-settimeout-setimmediate-promise-then-and-after-eb8eb2a932a6
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: 3
- Tags: nodejs, asynclocalstorage, async_hooks

Inside als.run('A', fn), getStore() returned 'A' in a setTimeout callback, a setImmediate callback, a Promise.then callback, and after await null. Outside any run() it returned undefined. Tested on Node v22.23.3 with require('async_hooks').AsyncLocalStorage.
