n8n Schedule Trigger or a cron job: which to use

Use the n8n scheduler (the Schedule Trigger node) when the job is about connecting applications and you want to see each run inside n8n. Use a cron job when the job belongs to the server (backups, clean-ups, certificates) or when you want it to run even if n8n is down. And the two can work together.

The difference, side by side

n8n Schedule Trigger Cron job
Where it runs Inside n8n, which has to be up. In the server’s own system, independent of n8n.
Best for Workflows between applications: sheets, e-mail, shops, messages. Scripts and commands: backups, clean-ups, renewals.
What you see Each run with the data of every step, in n8n. Only what the command writes to a file or sends by e-mail.
How you change it In the workflow design, without touching the server. By editing the system’s task list.
If n8n stops It does not run. It runs anyway, but only suits what does not depend on n8n.
On a shared hosting plan Does not apply: there is no n8n. Available in cPanel. See cron jobs.

How to decide

1 Does the job pass through several applications? (read a sheet, send e-mails, write to a shop). Use the n8n scheduler, since everything is already there.
2 Is the job a server command? (a backup, deleting old files). Use cron. See automatic backups with cron.
3 Do you need to see each run and repeat one that failed? n8n keeps the history; cron does not.
4 Do you not want to depend on n8n being up? Use cron for the essentials and leave n8n for the rest.
5 Both at once: cron calls an n8n webhook with curl at the set time, and n8n does the rest. The schedule lives in the system and the work in n8n.

The traps in timing

Trap What to do
The hour is off The n8n time zone, the container’s and the server’s may differ. Set n8n’s time zone (the GENERIC_TIMEZONE variable) and check the workflow’s own as well.
The scheduled workflow does not run The workflow has to be active. One that is only saved does not fire.
A run was missed while n8n was down It is not made up afterwards. If that matters, the workflow should know how to fetch whatever was left unprocessed.
Two runs overlap If one takes longer than the interval, the next starts on top of it. Lengthen the interval or add a “running” marker.
Several workflows at the same hour Spread out the times, so you do not fill the memory: n8n running out of memory.
Cron has five time fields (minute, hour, day of month, month, day of week) and a mistake in one changes everything. Test the command by hand before scheduling it, and check the time the task should have run.
To run a PHP script at a set time, see running a PHP script from a cron job. For WordPress, swapping WP-Cron for a real server cron job.

Want a machine where the jobs always run?

See the VPS servers

SEE ALSO

Cron jobs: what they are for and how to create one

Running a PHP script from a cron job

n8n webhooks: test URL and production URL

RECOMMENDED PRODUCT

Web hosting with cPanel

Domain and SSL included, daily backups and the panel you already know. from $6.59/mo (3-year plan, with coupon)

See plans
  • 0 Users Found This Useful
Was this answer helpful?