# Flow runs at midnight, but should not

**URL:** <https://discourse.nodered.org/t/flow-runs-at-midnight-but-should-not/42268>\
**Category:** General\
**Created:** [8 March 2021 13:07 UTC](https://discourse.nodered.org/t/flow-runs-at-midnight-but-should-not/42268 "2021-03-08T13:07:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![cwesterfield](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cwesterfield/32/38432_2.png) [@cwesterfield](https://discourse.nodered.org/u/cwesterfield)\
**Post date:** [8 March 2021 13:07 UTC](https://discourse.nodered.org/t/flow-runs-at-midnight-but-should-not/42268/1 "2021-03-08T13:07:36Z")

</div>

I built a simple api grabber that can run every 10 minutes between 7 AM and 8PM and email me if there is a status change.

For some reason, it kicked off last night at midnight. I'm not really sure what I did wrong. Is there a "run all nodes" at midnight setting or something? I have it installed from the official docker.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/c/9cd9dc3eedc54d89ed5398b82e0995bbd7f64413.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/1/c16397ced62940e507662f8f5820ae5216d5a9a1.png)

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [8 March 2021 14:01 UTC](https://discourse.nodered.org/t/flow-runs-at-midnight-but-should-not/42268/2 "2021-03-08T14:01:46Z")

</div>

Does it run every midnight? If not how often does it run at midnight or don't you know yet.

---

<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:** [8 March 2021 23:15 UTC](https://discourse.nodered.org/t/flow-runs-at-midnight-but-should-not/42268/3 "2021-03-08T23:15:14Z")

</div>

You could use something like node-red-contrib-flogger to log events from the inject node - see if it is triggering unexpectedly.

Also, as an alternative to the inject node you could setup something like cron-plus...

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/f/4fe479337a10087e728027e9c02c4556a5ea009a.png) to do your scheduled events.

---

<div class="post-metadata">

**Author:** ![cwesterfield](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cwesterfield/32/38432_2.png) [@cwesterfield](https://discourse.nodered.org/u/cwesterfield)\
**Post date:** [9 March 2021 12:49 UTC](https://discourse.nodered.org/t/flow-runs-at-midnight-but-should-not/42268/4 "2021-03-09T12:49:05Z")

</div>

I got the flogger thing setup, what a neat little node.

The first thing I saw was times not lining up between docker and node-red.

```auto
2021/03/09 12:10:00 INFO [msg.payload] 1615291800009
2021/03/09 12:20:00 INFO [msg.payload] 1615292400009
2021/03/09 12:30:00 INFO [msg.payload] 1615293000005
2021/03/09 12:40:00 INFO [msg.payload] 1615293600004

```

These were from 6:10, 6:20, so on.

I find an article to map /etc/localtime and /etc/timezone into the docker.

I'll monitor and see if that's all it was.

---

<div class="post-metadata">

**Author:** ![cwesterfield](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cwesterfield/32/38432_2.png) [@cwesterfield](https://discourse.nodered.org/u/cwesterfield)\
**Post date:** [9 March 2021 13:12 UTC](https://discourse.nodered.org/t/flow-runs-at-midnight-but-should-not/42268/5 "2021-03-09T13:12:12Z")

</div>

Okay so now it's great!

```auto
2021/03/09 12:40:00 INFO [msg.payload] 1615293600004
2021/03/09 07:00:00 INFO [msg.payload] 1615294800003
2021/03/09 07:10:00 INFO [msg.payload] 1615295400003

```

Glad it was something simple, thanks for the tip about flogger, that could have been a headache.

---

<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:** [23 March 2021 13:12 UTC](https://discourse.nodered.org/t/flow-runs-at-midnight-but-should-not/42268/6 "2021-03-23T13:12:52Z")

</div>

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