Skip to content
MoveWorkflows

n8n error workflows with the Error Trigger node

Updated 2026-10-21 · 5 min read

In short
  • An error workflow starts with Error Trigger and runs when another workflow fails.
  • It fires only when an automatic execution fails, never on manual test runs.
  • Turn on Save failed production executions, or the alert has no link to the run.
Check my export – free reportRuns in your browser. Nothing is uploaded.
On this page · 8 sections
  1. Set it up
  2. The payload
  3. An alert that's useful at 3 a.m.
  4. Stop and Error: fail on purpose
  5. Error workflow vs node settings
  6. Execution retries
  7. Several error workflows
  8. Coming from Pipedream

An n8n error workflow is a separate workflow. It runs whenever another workflow's execution fails. It starts with the Error Trigger node, which receives the details of the failure. Then it does whatever you want with them: post to Slack, send an email, open a ticket. One error workflow can cover every workflow on the instance.

This page is the reference: setup, the exact data the trigger gets, an alert template, and how error workflows fit with retries and error outputs on single nodes. Coming from Pipedream's error emails, auto-retry and $errors source? See Pipedream error handling to n8n.

Set it up

  1. Create a workflow with Error Trigger as the first node. Name it, for example, Error Handler, and save.
  2. Add the alert nodes after it.
  3. In each workflow you want covered, open Workflow Settings. Pick Error Handler under Error workflow (to notify when this one errors) and save.

Three rules from the Error Trigger docs:

  • A workflow that uses the Error Trigger doesn't have to be published.
  • By default, a workflow that contains the Error Trigger uses itself as its error workflow.
  • You can't test it with manual runs. It fires only when an automatic execution fails.

To test it anyway, build a small workflow: a Schedule Trigger every minute, then a Stop and Error node. Set the error workflow, publish, and wait for the first run. Unpublish it afterwards.

The payload

The payload is the data the Error Trigger outputs. When a node fails after the trigger ran, it looks like this:

{
  "execution": {
    "id": "231",
    "url": "https://n8n.example.com/execution/231",
    "retryOf": "34",
    "error": { "message": "Example Error Message", "stack": "Stacktrace" },
    "lastNodeExecuted": "Node With Error",
    "mode": "manual"
  },
  "workflow": { "id": "1", "name": "Example Workflow" }
}
Field Present when
execution.id, execution.url The execution was saved to the database
execution.retryOf The execution is a retry of a failed one
execution.error.message / .stack Always (for errors outside the trigger)
execution.lastNodeExecuted Always: it names the node that failed
workflow.id, workflow.name Always

Sometimes the trigger node of the failing workflow is what broke. For example, a webhook or polling trigger couldn't activate. Then the payload has a trigger object, and execution holds less. The error inside trigger has name (such as WorkflowActivationError), message, timestamp and node.

In the covered workflows' settings, turn on Save failed production executions. Otherwise execution.url is missing, and your alert can't link to the run.

An alert that's useful at 3 a.m.

A Slack or email message with this text, built with expressions:

FAILED: {{ $json.workflow.name }}
Node: {{ $json.execution.lastNodeExecuted }}
Error: {{ $json.execution.error.message }}
{{ $json.execution.url }}
{{ $json.execution.retryOf ? 'Retry of ' + $json.execution.retryOf : '' }}

For trigger failures, execution.url won't exist. So add an If node on {{ $json.trigger !== undefined }} and send a different message.

Useful additions:

  • Deduplicate. A broken schedule that runs every minute sends 60 alerts per hour. Store the last alert time per workflow in a Data table, and skip repeats within an hour. Pipedream did this for you. n8n doesn't.
  • Route by workflow. A Switch node on workflow.name or on a tag sends finance workflows to the finance channel.
  • Keep it simple. If the error workflow calls a flaky API and fails itself, you lose the alert. Slack, or email via SMTP, are good first channels.

Stop and Error: fail on purpose

Some failures don't throw an error. An API returns 200 with "success": false, or a lookup finds nothing. Add a Stop and Error node on that branch (docs):

Error Type You provide
Error Message A string, expressions allowed: Customer {{ $json.id }} not found
Error Object A JSON object with the properties you want to pass on

The execution fails and shows as failed in the Executions list. The error workflow receives your message.

Error workflow vs node settings

An error workflow tells you that something failed. Node settings decide whether a failure stops the run (node settings):

Setting (node Settings tab) Effect
Retry On Fail Runs the node again on failure; set Max Tries and Wait Between Tries (ms)
On Error: Stop Workflow The default. The execution fails and the error workflow runs
On Error: Continue Goes on with the last valid data
On Error: Continue (using error output) Adds an error output; failed items go there with the error info
Always Output Data Outputs an empty item even when the node returns nothing

A robust pattern for API calls:

  1. Retry On Fail on the HTTP Request node: 3 tries, 5000 ms apart, for short-lived errors.
  2. Continue (using error output) for failures of single items. Send failed items to a Data table or a "needs review" sheet, so one bad record doesn't stop the batch.
  3. Error workflow for everything else: the run failed, and a person should look.

Be careful with Continue. The workflow succeeds, no alert fires, and the bad data travels on. Use the error output instead, so failures stay visible.

Execution retries

You can retry failed executions from the Executions list. A retry carries retryOf with the original execution ID. So your error workflow can tell first failures from failed retries. For example, it can escalate only failed retries.

Several error workflows

You can have more than one. For example, a noisy one for internal tools and a paging one for customer-facing workflows. Each workflow picks one in its settings. Sub-workflows called with Execute Sub-workflow have their own setting too, see n8n sub-workflows.

Coming from Pipedream

Pipedream did three things for you (Pipedream errors):

  • it emailed you on unhandled errors, at most once per error, per workflow, per 24 hours;
  • it offered auto-retry on the Advanced plan, up to 8 times over 10 hours;
  • it let you build a global handler from the Workspace $error events source.

None of that is in the export. After you migrate, nothing alerts you until you set the error workflow on every imported workflow. Make it the first thing you do after the import, before you switch traffic.

Our converter report lists every workflow, so you can tick them off as you assign the error workflow. Code steps that catch errors and call $.flow.rerun() have no direct equivalent. The Code node compatibility check flags them. The report and 1 workflow are free. Full export: $3 per workflow, $1 each after 50, $19 minimum, one-off. Full process: migrate Pipedream to n8n.

Not affiliated with Pipedream or n8n.

FAQ

How do I get notified when an n8n workflow fails?

Create a workflow that starts with the Error Trigger node and sends a message (Slack, email, Telegram). Then select it under Workflow Settings > Error workflow in every workflow you want covered.

Does the error workflow need to be published?

No. n8n's docs say a workflow that uses the Error Trigger node doesn't have to be published.

Why doesn't my error workflow run when I test?

The Error Trigger only runs when an automatic (production) execution fails. Errors in manual test runs don't trigger it.

What data does the Error Trigger receive?

An execution object (id, url, retryOf, error message and stack, lastNodeExecuted, mode) and a workflow object (id, name). If the trigger node itself failed, it gets a trigger object instead of most execution fields.

How do I make a workflow fail on purpose?

Add a Stop and Error node. It fails the execution with your Error Message or Error Object, and the error workflow receives it.