Initialise msg.payload after deploy

#1

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 ?

0 Likes

#2

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.

0 Likes

#3

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.

0 Likes