# What resets global variables to "undefined"

**URL:** <https://discourse.nodered.org/t/what-resets-global-variables-to-undefined/15700>\
**Category:** General\
**Created:** [19 September 2019 17:44 UTC](https://discourse.nodered.org/t/what-resets-global-variables-to-undefined/15700 "2019-09-19T17:44:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sallen135](https://avatars.discourse-cdn.com/v4/letter/s/eada6e/32.png) [@sallen135](https://discourse.nodered.org/u/sallen135)\
**Post date:** [19 September 2019 17:44 UTC](https://discourse.nodered.org/t/what-resets-global-variables-to-undefined/15700/1 "2019-09-19T17:44:18Z")

</div>

I am trying to understand what causes global variables to be reset. I feel like most times I hit deploy it does not reset them, but sometimes when I deploy all get set to undefined.

The background to this questions is I had some kind of power surge last night and the monitor connected to my Pi turned off, among other things. All of my global variables had been reset to undefined, but node red did not deploy and was still running fine.

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [19 September 2019 17:54 UTC](https://discourse.nodered.org/t/what-resets-global-variables-to-undefined/15700/2 "2019-09-19T17:54:15Z")

</div>

It will depend on what kind of deploy you do  
and how you have setup the context store  
[https://nodered.org/docs/user-guide/context](https://nodered.org/docs/user-guide/context)

---

<div class="post-metadata">

**Author:** ![sallen135](https://avatars.discourse-cdn.com/v4/letter/s/eada6e/32.png) [@sallen135](https://discourse.nodered.org/u/sallen135)\
**Post date:** [19 September 2019 20:13 UTC](https://discourse.nodered.org/t/what-resets-global-variables-to-undefined/15700/3 "2019-09-19T20:13:32Z")

</div>

Thank you for the reply. My context store is default, and I always use full deploy. Other threads show that any kind of deploy is not supposed to reset the global variables, are you saying thats not the case?

If deploy does not reset them, is the only way to restart node red entirely?
