Cron to n8n: Scheduling, Execution History, Alerting Gap
In this article
- Background: What cron does and where it falls short
- How n8n scheduling works
- Execution history: what n8n stores and what it hides
- The alerting gap: n8n does not notify you by default
- Comparing cron and n8n for production workloads
- Common pitfalls and how to avoid them
- Costs and operational considerations
- Alternatives and when to stick with cron
- Frequently Asked Questions
Replacing cron jobs with n8n does not automatically give you better execution history or alerting—you must explicitly configure both, because n8n's default behavior only logs executions and does not proactively notify you of failures. This article explains what n8n actually provides for scheduling, execution history, and alerting, where the gaps are compared to traditional cron, and how to close them with concrete settings and workflows.
Background: What cron does and where it falls short
Cron is the Unix job scheduler that runs commands at fixed times, dates, or intervals. It has been the backbone of automation for decades because it is simple, reliable, and nearly universal. However, cron has well-known operational weaknesses:
- No built-in execution history—you must manually redirect output to a log file, and even then there is no structured record of success or failure.
- No native alerting—if a job fails, cron silently exits with a non-zero code unless you write a wrapper script to send an email or message.
- No retry logic—a failed job is simply failed; you need an external supervisor.
- No dependency management—cron does not know if a previous run completed before starting the next one.
n8n addresses some of these gaps by providing a visual workflow editor, a built-in scheduler node, and a database of execution records. But it does not, out of the box, replace the discipline of monitoring that cron users have built with custom scripts. You must deliberately design alerting and retention.
How n8n scheduling works
n8n's Schedule Trigger node is the direct replacement for cron entries. It supports cron expressions or a simple interval (e.g., every hour). You can set timezone, which is a major improvement over cron's server-local time handling. The trigger starts a workflow, and each run is recorded in the executions database.
Key scheduling features:
- Cron expression support (standard five-field format, plus seconds if needed).
- Interval mode for simple "every N minutes/hours/days" schedules.
- Timezone selection per trigger, avoiding the classic cron pitfall of UTC vs local time.
- Activation toggle—you can pause a schedule without deleting it.
One important difference: cron jobs are separate processes run by the system; n8n workflows are triggered by the n8n server. If the n8n server is down, no scheduled runs occur. Cron, in contrast, is managed by the init system and generally starts at boot. You need to ensure n8n runs as a service with proper restart policies.
Execution history: what n8n stores and what it hides
n8n records every execution (manual, test, or scheduled) in its database. The UI shows a list with status (success, error, waiting), start time, and duration. You can click into a run to see input/output data for each node, which is far richer than cron's logs.
However, there are gaps:
- Retention: n8n has a default execution data retention period (commonly 24 hours for successful runs in some versions, configurable via environment variables like
EXECUTIONS_DATA_PRUNE). If you need long-term history, you must adjust these settings or export data. - No built-in dashboard: The executions list is not a monitoring tool. It does not show trends, failure rates, or average durations over time.
- Data volume: Storing every execution with full data can bloat the database. Production setups often prune or archive old executions.
- API access: You can query executions via the REST API, which is useful for building custom dashboards, but that requires additional development.
For a cron replacement, you should decide how long you need history for auditing or debugging. If you need months of data, configure pruning accordingly or set up a workflow that periodically exports execution summaries to a file or external database.
The alerting gap: n8n does not notify you by default
This is the biggest misconception. Many users assume that because n8n is a modern tool, it will email them when a scheduled job fails. It does not. The Schedule Trigger starts a workflow; if a node throws an error, the execution is marked as failed, but no one is told. You must build alerting into each workflow or use a global mechanism.
Options for alerting:
- Error Workflow: n8n allows you to set a workflow as the "Error Workflow" for another workflow. When an execution fails, the error workflow runs with details of the error. You can use it to send an email, Slack message, or webhook call.
- Try/Catch nodes: Within a workflow, you can add an
Error Triggeror use theTry/Catchnode (available in later versions) to handle errors gracefully and send alerts for specific failures. - External monitoring: Use a service like UptimeRobot or Healthchecks.io that expects a ping from the workflow after successful completion. If the ping does not arrive, the service alerts you. This also catches the case where the n8n server itself is down.
- Custom notification nodes: n8n has nodes for email (SMTP), Slack, Discord, Telegram, etc. Add one at the end of the error path.
A common pattern is to create a dedicated "Alert" workflow that sends a standardized message, then call it from any workflow's error path via the Execute Workflow node. This centralizes alerting logic.
Comparing cron and n8n for production workloads
When deciding whether to replace cron with n8n, consider the following dimensions:
- Complexity: For a single command that runs once a day, cron is simpler and more reliable. n8n adds a dependency on a Node.js server and a database.
- Visibility: n8n wins hands-down for inspecting what happened, with per-node logs and data previews.
- Error handling: n8n allows branching on errors, retries, and fallback logic—cron requires you to write that logic yourself.
- Portability: Cron jobs are tied to a Unix environment; n8n workflows are JSON and can be imported/exported, making them more portable across systems.
- Resource usage: n8n is a full application; cron is a lightweight system process. For high-frequency jobs (every second), cron is more appropriate.
- Security: n8n exposes an API and UI; you must secure it properly. Cron is inherently more isolated.
In practice, many teams use a hybrid: keep simple, high-frequency tasks in cron, and move complex, multi-step workflows to n8n where its features add value.
Common pitfalls and how to avoid them
Migrating from cron to n8n introduces several subtle issues:
- Timezone confusion: Always set the timezone explicitly in the Schedule Trigger, even if it matches the server time. Otherwise, daylight saving changes can shift your schedule.
- Missed runs due to server downtime: n8n does not catch up on missed schedules. If the server was off, those runs are lost. Cron has the same behavior, but cron is more likely to be running as part of the OS. Ensure n8n starts on boot and consider a health-check service.
- Execution data explosion: If you run a workflow every minute, you generate 1,440 executions per day. Prune old data or disable saving for high-frequency workflows that do not need audit trails.
- Error workflow loops: If your error workflow itself fails, you get no alert. Test your error path thoroughly.
- Assuming retries are automatic: n8n does not retry failed executions by default. You must add a
Retrynode or use the error workflow to re-trigger the workflow with a delay.
One misconception is that n8n's execution history is a substitute for monitoring. It is not. History tells you what happened, but it does not tell you in real time that something is broken. You still need active alerting.
Costs and operational considerations
n8n is open-source and free to self-host, but that does not mean it is free to operate. You need a server with Node.js, a database (SQLite for small setups, PostgreSQL for production), and ongoing maintenance. The official cloud version has a subscription fee, but the self-hosted community edition is free.
Operational costs include:
- Server resources: n8n is relatively lightweight but not negligible. A small VM is sufficient for moderate workloads.
- Backup and recovery: You need to back up the n8n database and workflow JSON files.
- Upgrades: n8n releases frequently; you must plan for version updates.
- Security: Expose the n8n UI/API only over HTTPS with authentication. Consider reverse proxy and firewall rules.
Compared to cron, which has zero additional cost, n8n introduces a real footprint. Only adopt it if the benefits of visual workflows, better error handling, and execution history outweigh these costs.
Alternatives and when to stick with cron
n8n is not the only option. Other workflow automation tools (e.g., Apache Airflow, Prefect, Node-RED) offer similar scheduling and alerting capabilities. If your primary need is just reliable scheduling with alerts, you might be better served by:
- Systemd timers: Modern Linux systems use systemd timers, which are more flexible than cron and can send emails on failure via
OnFailure=. - Healthchecks.io or Cronitor: These services wrap cron jobs and alert you if they do not run. They are simpler than migrating to n8n.
- CI/CD pipelines: For tasks that are part of a build or deployment, tools like GitHub Actions or GitLab CI can schedule jobs with built-in notifications.
If you are already using n8n for other automations, extending it to replace cron makes sense. But if you have a single simple job, setting up n8n is overkill. Evaluate your actual requirements for history, alerting, and complexity before making the switch.
Frequently Asked Questions
Does n8n send an email when a scheduled workflow fails?
No, not by default. You must create an error workflow that sends an email or message. The error workflow receives details about the failure and can trigger any notification node.
Can I import my existing crontab into n8n?
There is no direct import. You must manually create a Schedule Trigger for each cron entry and copy the cron expression. The expression syntax is compatible, but the rest of the job (the command) must be recreated as n8n nodes.
Does n8n guarantee that a scheduled job runs exactly at the specified time?
No. Scheduling is subject to server load and n8n's internal processing. In practice, delays are usually milliseconds, but for high-precision timing, cron is more reliable because it is handled by the OS scheduler.
How long does n8n keep execution history?
It depends on your configuration. The default retention is often set to 24 hours for successful executions and longer for errors, but you can change it via environment variables. For permanent history, you should export or archive data.
Can n8n retry a failed scheduled job automatically?
Yes, but you have to build it. You can use the error workflow to re-execute the original workflow after a delay, or use the Retry node if your n8n version supports it. There is no built-in retry policy.
Is n8n a good replacement for cron in a production environment?
It can be, if you need complex workflows, better visibility, and are willing to invest in setup and monitoring. For simple, critical jobs, cron with a monitoring service is often more robust and easier to maintain.