How to enable a schedule trigger only from 00:00 to 17:00?

Hello, today I have a simple flow that enables a series of blocks from a Schedule Trigger that is enabled every 5 minutes. But I don’t want it to turn on between 5 pm and midnight. But the schedule trigger doesn’t accept an input, which I would do with an if. Can you help me with a solution? Thanks.

  • n8n version: 1.60.1
  • Database (default: SQLite): mariadb
  • n8n EXECUTIONS_PROCESS setting (default: own, main): own
  • Running n8n via (Docker, npm, n8n cloud, desktop app): npm
  • **Operating system: Windows **

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Welcome to the community @henriquesv !

Tip for sharing information

Pasting your n8n workflow


Ensure to copy your n8n workflow and paste it in the code block, that is in between the pairs of triple backticks, which also could be achieved by clicking </> (preformatted text) in the editor and pasting in your workflow.

```
<your workflow>
```

That implies to any JSON output you would like to share with us.


You can use a custom cron expression, 0 */5 0-17 * * *.

Thank you! That worked perfectly. Just one more question—would it be possible to exclude weekends? Thanks again!

Hey @henriquesv , absolutely. The last element represents the day of the week. Thus, you can amend the cron to become

0 */2 0-17 * * 1-5

or even more verbally as

0 */2 0-17 * * mon-fri
2 Likes

Thank you very much! I really should study more about CRON! :sweat_smile: :ok_man:

2 Likes