# Initialise msg.payload after deploy

**URL:** <https://discourse.nodered.org/t/initialise-msg-payload-after-deploy/8006>\
**Category:** General\
**Created:** [15 February 2019 11:42 UTC](https://discourse.nodered.org/t/initialise-msg-payload-after-deploy/8006 "2019-02-15T11:42:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hathemi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hathemi/32/3792_2.png) [@hathemi](https://discourse.nodered.org/u/hathemi)\
**Post date:** [15 February 2019 11:42 UTC](https://discourse.nodered.org/t/initialise-msg-payload-after-deploy/8006/1 "2019-02-15T11:42:12Z")

</div>

where did node-red save it variables? each time i deploy my project. i found that msg.payload doesn't be initialed in mytemplate? i have cleared my navigator cache, i have been search a lot wich file cantains saved variable but without results.!!!  
Can anyone explain to me this ?

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [15 February 2019 12:03 UTC](https://discourse.nodered.org/t/initialise-msg-payload-after-deploy/8006/2 "2019-02-15T12:03:02Z")

</div>

Unless you set up file-based retention, variables are stored only in memory. That means that if you restart Node-RED or do a full deploy, everything is reset.

Partial deploys may not reset some variables.

It is all in the docs.

---

<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:** [15 February 2019 12:17 UTC](https://discourse.nodered.org/t/initialise-msg-payload-after-deploy/8006/3 "2019-02-15T12:17:08Z")

</div>

and msg.payload is sent to your template by the previous node and wouldn’t be saved.  
You can save certain variables (context variables) between node-red restarts as explained in the docs, but you would have to then add them into your flow rather than expect a template looking for msg.payload to know about them.
