Run a flow every 5 minutes as a cron job

Hi there,

I'm a newb to node red, but I'm an IT professional that has a background in LAMPP servers and a full stack PHP developer that has been developing things since 2004 in PHP, so I'm not sure I qualify as a newb in general.

Here's what I want to do with node-red, that I think should be possible but I just need a nudge in the right direction:

Say every 5 minutes, I want to query a Postgres database for new records in a specific table that meet specific criteria, and then manipulate and insert that data into a MariaDB (MySQL) database in a destination table.

I can handle the technical details of the above without any help. What I'm less certain about is how to call this flow once it has been built and deployed on my node-red dev server. Ideally I would think this would be a cron job like this:

*/5 * * * * * /home/devguy/some-bash-script-or-nodered-bin /path/to/flow/process/or/call/by/flow/name

Is this possible, or is there an alternate way to do this?

UPDATE: And of course, after I thought I had searched on all the things before posting, I find an answer, which is:

Just in case someone else needs it. :slight_smile:

Simpliest solution: you can set an inject node to start every 5 minutes.
If you are familiar with Linux and cron, the above cronplus node may be an alternative, though.

I agree with Stefan @stefan24 - using an 'inject' node is nice and simple (as Cron-Plus might be a bit of an overkill in this situation).

I use cron-plus in a number of my flows to turn things On/Off at 'specific' times.


For example, turn On at 08:00 hrs and Off at 22:00 hrs.

I use cron node to trigger things at intervals, for example every 1 minute or 5 minute. It hits the minute mark on the spot (at 0 seconds), unlike normal inject node. The only scheduling vanilla inject handles easier is actually to trigger at a specific time.

I think the default behaviour of the inject node is to trigger at (eg) 5 minutes after deploy, then 5 minutes after that...

But the repeat at interval between times option, which can be "between 00:00 and 00:00", fires at exactly the hour, 5 minutes past, etc.

Unfortunately, the begin and end times can only be whole hours.

I think this mode of inject uses cron in the background. On Linux anyway.