Does Node-RED automatically clear global context variables during a flow deployment?
0 reputation · 18 Mar 2026, 18:41 UTC
When developing flows that rely on global context for sharing state between nodes, it is important to know whether Node-RED resets this store each time a flow is deployed. The documentation states that global context variables persist across deployments unless they are explicitly cleared, but it does not specify whether a runtime option exists to automate that clearance.
Understanding if such an automatic reset is available helps designers decide whether they must implement custom cleanup logic in each node or rely on a configuration flag. This uncertainty becomes relevant in environments where frequent deployments occur and stale global state could lead to unintended behavior.
Does Node-RED provide a setting to clear global context on every deployment? If not, what is the recommended approach to ensure a clean global state between versions? Are there any risks associated with manually clearing the global context via the API during a deploy?