Learning CenterWorkflow AutomationScheduling and Cron Patterns
Beginner5 min read

Scheduling and Cron Patterns

Run automations on time-based schedules using cron syntax and n8n's schedule trigger.

When to Use Scheduled Workflows

Use scheduling for: regular reports, data syncs, cleanup tasks, monitoring checks, and any workflow where you want periodic execution rather than event-driven execution.

Cron Syntax

Cron expressions define schedules: minute hour day-of-month month day-of-week

Common patterns:

0 9 * * 1-5     # 9am weekdays
0 0 * * *       # midnight daily
*/5 * * * *     # every 5 minutes
0 8 1 * *       # 8am on the 1st of each month
0 */6 * * *     # every 6 hours

n8n's Schedule trigger has a visual cron builder if you prefer not to write cron syntax directly.

Timezone Handling

Always specify timezone for scheduled workflows. A cron expression without timezone context means different things in different environments.

Store and display times in UTC; display to users in their local timezone. Never store local times in databases.

Idempotent Scheduled Workflows

Scheduled workflows should be idempotent. If a workflow runs twice (due to a bug or manual trigger), it should produce the same result as running once.

Pattern: check if work is already done before doing it again.

If report_for_date already exists → skip
Else → generate report → mark complete

Monitoring Scheduled Workflows

Track: last successful run, last run time, error rate per run, and any missed runs. Alert if a workflow doesn't run within 2x its expected interval.

Scheduled workflows fail silently more often than webhook-triggered ones — they're not responding to visible events.

Loading…