Hello,
I have a Node-RED function node that outputs a message periodically. I would like to save this message to a file so that if Node-RED restarts, I can retrieve the last saved message but cannot inject it back into the function node when Node-RED starts up again.
The issue I'm running into is that when Node-RED restarts, the previous message in the function node gets cleared out. I need a way to persistently store the message from the function node so that it is not lost on restart.
My thought is to have the function node write its output message to a file periodically. Then on Node-RED startup, I can read the last saved message from that file and inject it into the function node to pick up where it left off before the restart. This would prevent losing the message and state on a restart. But I tried and not working.
Please let me know if you have any suggestions on the best approach to persistently store the message from the function node and re-inject it on startup.
[{"potNumber":137,"anodeNumber":8,"eventBoxes":[{"box_id":"1_137_8","id":1,"event":"CrustBreaker","PotNum":137,"AnodeNum":8,"StartTime":"10:48:38","StartDate":"10/15/2023","StopTime":"10:48:39","StopDate":"10/15/2023","EventDuration":1,"flowId":1},{"box_id":"3_137_8","id":3,"event":"AnodeRemoval","PotNum":137,"AnodeNum":8,"StartTime":"10:48:45","StartDate":"10/15/2023","StopTime":"10:48:49","StopDate":"10/15/2023","EventDuration":4,"flowId":1},{"box_id":"6_137_8","id":6,"event":"CavityScoop","PotNum":137,"AnodeNum":8,"StartTime":"10:48:51","StartDate":"10/15/2023","StopTime":"10:48:53","StopDate":"10/15/2023","EventDuration":2,"flowId":1},{"box_id":"9_137_8","id":9,"event":"NewAnodeInstall","PotNum":137,"AnodeNum":8,"StartTime":"10:49:31","StartDate":"10/15/2023","StopTime":"10:49:32","StopDate":"10/15/2023","EventDuration":1,"flowId":1}],"sequenceComplete":1,"currentSequencePosition":4}]