Managing flow running at interval with time

I have a flow which is injecting timestamp on debug console for every 8 hours.
Now, lets consider at 8 AM I have started flow, so it will inject timestamp at 8 AM and next time it injects after 8 hours i.e at 4PM.
If in case, node red suddenly stopped due to some reason.When I restart node red it will start injecting and calculate 8 hours from that time. My requirement is it should not happen as it should inject after 8 hours from 8 Am only. i.e at 4 PM. How can achieve this?

I think you need to set the inject node a bit more.

You would need 3 of them.
All set at their respective times. 08:00, 16:00 and 00:00

[{"id":"6325808a.0d9d8","type":"inject","z":"88de1ac2.8b8c38","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"00 16 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":180,"y":1020,"wires":[[]]}]

Or use a cron node. (cron-plus for instance)
That allows more detailed events.

1 Like

node-red-contrib-cron-plus node is infinitely flexible...



And you can send the output from 1 output or 3 outputs...


Thanks for the help :slightly_smiling_face:

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.