Run workflow based on current time

Hi there.
I am new to the n8n community and trying to set up two workflows that I am having some slight issues with and hoping someone in the community can assist.
Workflow 1: Executes in 30 min interval during the day
Workflow 2: Executes at a specific time each day using cron.

How can I make workflow 1 only run when it is within a specific time period so it doesn’t run while workflow 2 is running?

Thanks in advance

Welcome to the community @Benjamin_Kassentoft!

You can achieve that by setting the mode of Workflow 1 to “Custom” and the setting a cron-expression.

If you do not have any experience doing that, you can use this website:

A possible one would be something like this:

0 */30 0-20,22-23 * * *

The website https://crontab.guru/#/30_0-20,22-23_** explains it: At every 30th minute past every hour from 0 through 20 and every hour from 22 through 23.

Be however aware that n8n uses one more “field” than the website does and it is for seconds. For that reason does my above example start with 0 but on the webseite, it is not there. It means simply that it should always run at second 0. Could obviously be also any other value between 0-59.

Hope that makes sense.

@jan:
A quick question about the timer trigger node. The custom setting uses the CRON standard for timing. Behind the scenes, does it use the actual user’s crontab in the system or does Node just use the CRON notation because it is a known was of configuring timings?

Just curious.

@Tephlon It is not using the system cron. Is a Node.js implementation which only uses the same syntax as it is commonly known. The library which gets used by n8n is this one:

1 Like