# Managing flow running at interval with time

**URL:** https://discourse.nodered.org/t/managing-flow-running-at-interval-with-time/47626
**Category:** General
**Created:** [25 June 2021 07:22 UTC](https://discourse.nodered.org/t/managing-flow-running-at-interval-with-time/47626 "2021-06-25T07:22:56Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![OmkarNodered](https://avatars.discourse-cdn.com/v4/letter/o/90ced4/32.png) [@OmkarNodered](https://discourse.nodered.org/u/OmkarNodered)
#### Post date: [25 June 2021 07:22 UTC](https://discourse.nodered.org/t/managing-flow-running-at-interval-with-time/47626/1 "2021-06-25T07:22:56Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)
#### Post date: [25 June 2021 07:29 UTC](https://discourse.nodered.org/t/managing-flow-running-at-interval-with-time/47626/2 "2021-06-25T07:29:21Z")

</div>

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

```auto
[{"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.

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [25 June 2021 07:37 UTC](https://discourse.nodered.org/t/managing-flow-running-at-interval-with-time/47626/3 "2021-06-25T07:37:07Z")

</div>

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

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/0/a06f4cf45a83f66a8e90e3bf95bb29b4d5f61e16.png)

or

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/e/ae380c06c28196346965b059a0fe2eeb3fa89e5b.png)

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

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/e/1ed5176043046503fd8157c89820d0fe3787bd67.png)

---

<div class="post-metadata">

### Author: ![OmkarNodered](https://avatars.discourse-cdn.com/v4/letter/o/90ced4/32.png) [@OmkarNodered](https://discourse.nodered.org/u/OmkarNodered)
#### Post date: [25 June 2021 08:39 UTC](https://discourse.nodered.org/t/managing-flow-running-at-interval-with-time/47626/4 "2021-06-25T08:39:16Z")

</div>

Thanks for the help 🙂

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [24 August 2021 08:40 UTC](https://discourse.nodered.org/t/managing-flow-running-at-interval-with-time/47626/5 "2021-08-24T08:40:01Z")

</div>

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