Node-RED node persistency (redeploy or restart)

Hello,

I love Node-RED. All my Home Assistant automotions are managed by Node-RED.
However I have sometimes unexpected results when I happen to restart or upgrade Node-RED, or sometimes even when just re-deploying a running flow. The reason is that most nodes states are lost when doing so.

For a few weeks now, I have replaced all my ‘Delay’ and timers nodes with this one : node-red-contrib-stoptimer-varidelay
node-red-contrib-stoptimer-varidelay (node) - Node-RED

It works beautifully and has a very interesting option : " Resume timer on deploy/restart" !
That changes everything !

I’m looking for the same option for some other nodes, like for example “limit” nodes that limit the number of message for a defined period of time, ‘gateway’, …

Do you know any other nodes that offer this capacity to persist on deploy/restart ?
How do you manage persistency with Node-RED ?

Thanks,
David

It may depends from usecase to usecase.
I consider fast changing data not worth persisting (like limiting to x messages per minute).
For slow data stream you can use persistenting of flow variables. it might mean a need to write own nodes (submodes) which stores own state.

Also some usecases might be not even worth of investment. Of course everyone has to evaluate that need.

1 Like

Thank you !

I agree with you.
Only a few of my flows need true persistency. They run over hours/days and control stuff like heating, ventilation,…

I’ve just discovered Node-RED Context persistency :
Working with context : Node-RED
A guide to understanding ‘Persistent Context’ - General - Node-RED Forum

That’s something I’m not familiar with. I will dig in this way and will probably persistent context to store data.

Yeah, this is what I meant while mentioning persisted flow variables.
Pretty usefully.