# Error Handling in n8n: How to Retry, Fail Gracefully, and Monitor Workflow Failures
- **url:** https://easify-ai.com/error-handling-in-n8n-monitor-workflow-failures/
- **published:** 2025-10-03
- **updated:** 2026-11-16
- **topics:** technologies-deep-dive
- **publisher:** Easify AI, part of Easify Technologies
An n8n workflow that fails loudly is an inconvenience. One that fails silently is a problem: the lead never reaches the CRM, the invoice never posts, and nobody finds out until a customer asks.
Good error handling is not about avoiding every failure. APIs time out, tokens expire and webhooks send odd payloads. The goal is that every failure is either recovered automatically or reported to someone who can act on it, with error tracking so you can see what failed and why.
This guide covers the settings n8n gives you for that, checked against the current n8n 2.x documentation as of November 2026.
## The three layers of error handling in n8n
Think of n8n error handling as three layers, each catching what the one before it missed.
| Layer | Where you set it | What it handles |
|---|---|---|
| Retry | Node settings: **Retry On Fail** | Temporary problems: timeouts, rate limits, brief outages |
| Route | Node settings: **On Error** | Failures you expect and can deal with inside the workflow |
| Report | Workflow settings: **Error Workflow** | Everything else: the run failed and a person needs to know |
A fourth layer sits outside n8n: watching the instance itself. We cover that in the monitoring section.
## Layer 1: Retry On Fail for temporary errors
Most failures in production are temporary. An API returns a 503, a request times out, a rate limit kicks in. Trying again a few seconds later usually works.
To turn on retries:
1. Open the node that calls the other service, for example an HTTP Request node.
2. Go to the node's **Settings** tab.
3. Switch on **Retry On Fail**.
4. Set **Max Tries** and **Wait Between Tries (ms)**.
The limits matter. n8n's docs state that Wait Between Tries is capped at 5,000 ms and Max Tries at five. That covers brief blips, not an API that blocks you for a minute.
> **Watch out:** Retrying a step that writes data can create duplicates. If a "create invoice" call timed out after the other system had already saved it, a retry creates a second invoice. Only retry writes when the step is safe to repeat, for example an upsert keyed on an ID.
For longer waits, build the retry into the workflow: a Wait node, an IF node that checks a counter, and a loop back. For rate limits on bulk calls, n8n recommends the **Loop Over Items** node to batch items with a **Wait** node between batches, or the **Batching** option on the HTTP Request node.
## Layer 2: On Error, for failures you can handle
Some failures are not temporary. A record is missing a required field, or a customer email bounces. Retrying will not help, but stopping the whole run is overkill.
Each node's **On Error** setting decides what happens:
| On Error option | What happens | Use it when |
|---|---|---|
| **Stop Workflow** | The run stops and is marked as failed | The step is essential and later steps make no sense without it |
| **Continue** | The workflow carries on using the last valid data | The step is optional, such as an enrichment call |
| **Continue (using error output)** | Failed items go down a separate error branch | You want to log, park or fix failed items while good ones carry on |
**Continue (using error output)** is the most useful in practice. It lets 98 good records go through while the two bad ones land in a review table or a Teams message, instead of failing all 100.
> **Tip:** Avoid plain **Continue** on steps that matter. It hides the failure completely: the run shows as successful and nobody is told.
### Fail on purpose with Stop and Error
Sometimes the data is wrong but no node errors. An order total of zero, or a contract with no end date, passes through quietly.
The **Stop and Error** node lets you turn a business rule into a real failure. Put it after an IF node that checks the rule, and the run fails with your message. That failure then triggers your error workflow like any other. It is also the simplest way to test your error handling before go-live.
## Layer 3: an n8n error workflow that tells someone
An error workflow is a separate workflow that runs whenever a linked workflow fails. It is where alerts and logging live, so you build them once rather than in every workflow.
```flow
trigger | Workflow fails | Any linked production run | n8n
tool | Error Trigger fires | Workflow, node, message, link | n8n
tool | Log the failure | One row per failed run | PostgreSQL
human | Owner gets the alert | Opens the run, fixes, re-runs
output | Nothing lost silently | Every failure has an owner | Microsoft Teams
```
To set one up:
1. Create a new workflow and add the **Error Trigger** node as its first node. n8n requires the error workflow to start with it.
2. Add the alert: a Slack, Microsoft Teams or email node with the workflow name, the failed node, the error message and a link to the execution.
3. Optionally add a database or spreadsheet node to log each failure.
4. Name it something obvious, such as "Error handler", and save.
5. In each production workflow, open **Settings** and choose it under **Error Workflow**. One error workflow can serve many workflows.
### What the Error Trigger gives you
| Field | What it contains |
|---|---|
| `workflow.name`, `workflow.id` | Which workflow failed |
| `execution.lastNodeExecuted` | The node where it stopped |
| `execution.error.message` | The error text |
| `execution.url` | A direct link to the failed run |
| `execution.mode` | How the run started, for example by a trigger |
| `execution.retryOf` | Present only if this run was itself a retry |
> **Note:** `execution.id` and `execution.url` only exist if the failed execution was saved. If the failure happens in the trigger node itself, the data arrives under `trigger` instead, with less detail about the execution.
A good alert answers three questions at a glance: what broke, where, and who owns it. Put the owner's name in the message. An alert sent to a shared channel that everyone assumes someone else is handling is barely better than no alert.
## Keep the evidence: save failed executions
When a run fails, you want to open it and see exactly what data each node received. That only works if n8n saved the execution.
In each workflow's settings, check **Save failed production executions**. On a self-hosted instance, the matching environment variable is `EXECUTIONS_DATA_SAVE_ON_ERROR=all`.
Successful runs are a different matter. Saving all of them fills your database quickly. A common pattern is to save failures, skip or shorten successes, and let pruning tidy up:
| Variable | What it does | Default |
|---|---|---|
| `EXECUTIONS_DATA_SAVE_ON_ERROR` | Which failed runs to save | Set to `all` |
| `EXECUTIONS_DATA_SAVE_ON_SUCCESS` | Which successful runs to save | `none` keeps the database small |
| `EXECUTIONS_DATA_PRUNE` | Deletes old finished runs on a schedule | `true` |
| `EXECUTIONS_DATA_MAX_AGE` | Hours before a run can be deleted | `336` (14 days) |
| `EXECUTIONS_DATA_PRUNE_MAX_COUNT` | Maximum finished runs to keep | `10000` |
On n8n Cloud, log retention depends on the plan: 7 days on Starter and 30 days on Pro, as of November 2026. If you need a longer record of failures, log them to your own database from the error workflow.
## Monitoring: watch the instance, not just the workflows
An error workflow runs inside n8n. If the server is down, out of memory or stuck, nothing fires and the silence looks like success. You need something outside n8n watching it.
- **Health checks.** Self-hosted n8n exposes `/healthz` (the instance is reachable) and `/healthz/readiness` (the database is connected and migrated). Point an external uptime monitor at them.
- **Metrics.** Set `N8N_METRICS=true` to enable a Prometheus-style `/metrics` endpoint on self-hosted instances, then chart it in Grafana or similar.
- **Queue mode workers.** Health checks on workers are off by default. Set `QUEUE_HEALTH_CHECK_ACTIVE=true` so you can monitor them too.
- **Insights.** n8n's Insights shows failed production executions and the failure rate. The summary banner is on every plan; the full dashboard needs Cloud Pro or Enterprise, or self-hosted Business or Enterprise.
- **A heartbeat.** A tiny scheduled workflow that pings an external monitor every few minutes. If the pings stop, n8n has stopped.
> **Example:** A scheduled workflow runs every five minutes and calls a heartbeat URL from your uptime tool. The tool alerts on-call if no ping arrives for 15 minutes, which catches a crashed container that no error workflow could report.
## What changed in n8n 2.0 for error handling
n8n 2.0 went stable in December 2025. A few changes affect how failures behave:
- **Publish replaces Activate.** Saving a workflow no longer pushes changes to production; you publish them. Remember to publish after fixing a failing workflow, or the old version keeps running.
- **Stalled jobs are not retried automatically in queue mode.** `QUEUE_WORKER_MAX_STALLED_COUNT` was removed, so a job that stalls on a crashed worker needs your attention rather than a silent retry.
- **Code nodes run in task runners and cannot read environment variables by default.** An alert built in a Code node that reads `$env` will fail unless you allow it with `N8N_BLOCK_ENV_ACCESS_IN_NODE=false`. Using credentials in regular nodes is the better fix.
## A short error handling checklist
1. **Every production workflow** has an Error Workflow set.
2. **Calls to other services** have Retry On Fail, with tries and waits that suit the API.
3. **Writes are safe to repeat**, or have no retries.
4. **Non-essential steps** use Continue (using error output), not plain Continue.
5. **Business rules** that must hold use Stop and Error.
6. **Failed executions are saved**, and pruning is set.
7. **Every alert names an owner.**
8. **Something outside n8n** checks that n8n is up.
9. **You have tested a failure** on purpose before go-live.
Our [n8n go-live checklist](/n8n-go-live-checklist-before-workflows-touch-real-data/) puts these alongside credentials, test data and ownership. If your workflows are getting large, splitting them into sub-workflows makes failures easier to locate, as covered in [designing modular n8n workflows](/modular-scalable-n8n-workflows-best-practices/).
If you would rather have this built and looked after, our [reliable n8n automations](/use-cases/reliable-n8n-automations/) work covers retries, error workflows, logging and monitoring across your whole instance.
## Summary
- **Retry first:** Retry On Fail handles temporary errors, up to five tries and 5,000 ms between them.
- **Route what you can:** Continue (using error output) keeps good items moving and parks bad ones for review.
- **Report the rest:** an error workflow starting with the Error Trigger tells a named owner what broke and where.
- **Keep the evidence:** save failed executions and set pruning so the database stays healthy.
- **Watch from outside:** health checks and a heartbeat catch the failures an error workflow cannot see.
## FAQ
### How do I get notified when an n8n workflow fails?
Create a separate workflow that starts with the Error Trigger node and sends a message to Slack, Teams or email. Then open each production workflow, go to Settings and choose that workflow under Error Workflow. One error workflow can serve all of them.
### What is the maximum number of retries in n8n?
The built-in Retry On Fail setting allows up to five tries, with at most 5,000 ms between them. For longer waits, such as an API that locks you out for 30 seconds, build the retry yourself with a Wait node and a counter, or with Loop Over Items and a Wait node.
### What is the difference between Continue and Continue (using error output)?
Continue carries on to the next node as if nothing happened, using the last valid data. Continue (using error output) adds a separate error branch to the node, so failed items go down their own path where you can log, park or fix them.
### Why is execution.url empty in my error workflow?
The execution link only exists if the failed execution was saved. Check that Save failed production executions is on in the workflow settings, or that EXECUTIONS_DATA_SAVE_ON_ERROR is set to all on a self-hosted instance. It is also missing when the failure happens in the trigger node.