# Global variable retention after deployment

**URL:** <https://discourse.nodered.org/t/global-variable-retention-after-deployment/97958>\
**Category:** General\
**Created:** [4 July 2025 09:40 UTC](https://discourse.nodered.org/t/global-variable-retention-after-deployment/97958 "2025-07-04T09:40:37Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sirhc](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@Sirhc](https://discourse.nodered.org/u/Sirhc)\
**Post date:** [4 July 2025 09:40 UTC](https://discourse.nodered.org/t/global-variable-retention-after-deployment/97958/1 "2025-07-04T09:40:37Z")

</div>

Hi

Out of interest are global variable values retained when you hit the deploy button in nodered for a full deployment?

Are the values only forgotten if the instance of nodered is restarted (e.g computer reboot?)

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [4 July 2025 09:54 UTC](https://discourse.nodered.org/t/global-variable-retention-after-deployment/97958/2 "2025-07-04T09:54:58Z")

</div>

> [@Sirhc](#):
>
> global variable

Can you define what you mean by a global variable? Do you mean global context?

---

<div class="post-metadata">

**Author:** ![Sirhc](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@Sirhc](https://discourse.nodered.org/u/Sirhc)\
**Post date:** [4 July 2025 10:24 UTC](https://discourse.nodered.org/t/global-variable-retention-after-deployment/97958/3 "2025-07-04T10:24:53Z")

</div>

Yes when you initiate a variable with global.set(“varname”, value)

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [4 July 2025 10:35 UTC](https://discourse.nodered.org/t/global-variable-retention-after-deployment/97958/4 "2025-07-04T10:35:11Z")

</div>

[See documentation](https://nodered.org/docs/user-guide/context); section 'context stores'

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [4 July 2025 11:23 UTC](https://discourse.nodered.org/t/global-variable-retention-after-deployment/97958/5 "2025-07-04T11:23:54Z")

</div>

Does that define what happens when you do a Full Deploy using the default context store?

@Sirhc I suggest you try it and report the answer back here.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [2 October 2025 11:24 UTC](https://discourse.nodered.org/t/global-variable-retention-after-deployment/97958/6 "2025-10-02T11:24:14Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
