n8n Error Workflow: Get Slack Alerts When Any Run Fails

Key takeaways
- An n8n error workflow must start with the Error Trigger node and only runs when an automatic production execution fails.
- One shared handler can serve every workflow once you select it under Options, Settings, Error workflow in each one.
- Nodes set to On Error: Continue can hide failures, so the error workflow never fires for those runs.
- Trigger failures send a different payload with details inside trigger, so normalise both shapes before alerting.
- Test with a scheduled workflow and a Stop and Error node, because manual executions never call the handler.
An n8n error workflow is a separate workflow that starts with the Error Trigger node and runs every time a production execution of a linked workflow fails. Point all your live workflows at one error workflow and you get a Slack or email alert naming the workflow, the node that broke and a link to the failed run, instead of finding out days later from a client.
This guide builds that alert step by step, shows exactly what data the trigger hands you, and covers the five reasons an error workflow stays silent when you expected it to fire. Everything here was checked against the n8n 3.4 documentation, the current release line as of December 2026.
What an n8n error workflow actually does
It catches failed production runs and lets you decide what happens next. You set it once per workflow in Workflow Settings, and the same handler can serve every workflow on your instance.
By default, a failing node stops the execution and marks it as an error in the Executions list. Nobody gets told. If you are not checking that list daily, a broken Facebook lead sync or a dead webhook can sit unnoticed for a week. An error workflow turns that silent red row into a message someone will actually read.
Three details from the official docs shape everything below:
- The handler must start with the Error Trigger node.
- It only runs when an automatic execution fails: a schedule, webhook or app trigger. Clicking Execute in the editor never fires it.
- A workflow that contains an Error Trigger uses itself as its own error workflow unless you change it.
The n8n documentation page on handling errors gracefully is the reference for the steps that follow, and it is listed with the other sources for this guide.
Build the n8n error workflow in 5 steps
Create one handler, publish it, then select it in each workflow you care about. The whole setup takes about fifteen minutes if your Slack credential already exists.
- Create the handler. Start a new workflow and add Error Trigger as the first node. Name the workflow something obvious, such as
Error Handler, and select Save. - Normalise the payload. Add a Code node after the trigger (example below). It flattens the two payload shapes n8n can send into four clean fields.
- Add the alert. Add a Slack node with the Message > Send operation and pick your alerts channel. Email works the same way if your team lives in an inbox.
- Publish the handler. The current Error Trigger docs say the workflow using this node has to be published, so publish it before you rely on it.
- Link your workflows. Open each production workflow, select Options > Settings, choose
Error Handlerin the Error workflow field and select Save.
If you self-host, do this before anything else goes live. It pairs well with the checklist in our guide to self-hosting n8n with Docker Compose, because a quiet server is only good news when you know alerts would have reached you.
What data the Error Trigger receives
You get the workflow name and ID, the last node that ran, the error message and stack, and a link to the execution. Some of those fields disappear in specific cases, which is why the Code node matters.
| Field | What it holds | When it is missing |
|---|---|---|
workflow.name / workflow.id | The workflow that failed | Always present |
execution.lastNodeExecuted | Name of the node where it broke | Present for normal node failures |
execution.error.message | The error text from the node or service | Present for normal node failures |
execution.id / execution.url | Link to the failed run | Missing if the execution was not saved to the database, or if the trigger node itself failed |
execution.retryOf | ID of the original run | Only present when this run was a retry |
trigger.error | Error details when the trigger failed | Only sent when the main workflow could not start at all |
That last row is the trap. When a trigger fails, for example an expired OAuth token on a polling trigger, n8n sends a different shape with most details inside trigger{} and an empty execution block. An alert template that only reads execution.error.message will post a blank message.
Write a Slack alert people can act on
A useful alert answers three questions without opening n8n: which workflow, which step, and what went wrong. Add the link so the person on duty lands on the exact run.
This Code node (JavaScript mode) handles both payload shapes. Treat it as an illustrative starting point and rename fields to suit your team:
const d = $input.first().json;
const triggerFailed = !d.execution;
return [{
json: {
workflow: d.workflow?.name || 'Unknown workflow',
step: triggerFailed ? 'Trigger node' : d.execution.lastNodeExecuted,
message: triggerFailed
? (d.trigger?.error?.message || 'Trigger failed to start')
: (d.execution.error?.message || 'No message returned'),
link: d.execution?.url || 'No saved run (trigger failure)'
}
}];
Then the Slack message text can stay short:
Workflow failed: {{ $json.workflow }}
Step: {{ $json.step }}
Error: {{ $json.message }}
Run: {{ $json.link }}
Keep the error workflow small. Every extra node is another thing that can fail while you are already dealing with a failure. If you want grouped daily summaries rather than one ping per crash, our Error Log Clustering Digest template clusters errors by signature and posts the worst offenders to Slack.
Node settings vs the error workflow
Node settings decide whether a failure counts as a failure; the error workflow only reacts to runs that end in a failed state. Mixing them up is the most common reason alerts never arrive.
Every node has a Settings tab with these options, per the n8n docs on working with nodes:
| Setting | What it does | Does the error workflow fire? |
|---|---|---|
| On Error: Stop Workflow (default) | Halts the run at the failing node | Yes |
| On Error: Continue | Moves on using the last valid data | No, the run can still finish as a success |
| On Error: Continue (using error output) | Sends error details down a separate branch | No, unless that branch fails the run on purpose |
| Retry On Fail | Reruns the node before giving up | Only after the final attempt fails |
Retry On Fail has hard limits: a maximum of five tries and no more than 5,000 ms between them, according to the n8n documentation on handling rate limits. For APIs that need longer cool-downs, use Loop Over Items with a Wait node instead.
A sensible default for marketing workflows: turn on Retry On Fail for HTTP and API nodes that hit flaky services, leave On Error at Stop Workflow for anything that writes data, and use the error output branch only where you genuinely have a fallback.
Force a failure with Stop and Error
Use the Stop and Error node when a run should count as failed even though no node crashed. It throws a custom error that the error workflow receives like any other.
The node has one parameter, Error Type, with two choices. Error Message takes plain text. Error Object takes a JSON object, handy when you want to pass structured details such as a lead ID or order number.
Typical places to add it:
- After an IF node that finds an empty API response where data was expected.
- At the end of a Continue (using error output) branch, after logging, so the run still ends as failed.
- When a Google Sheets lookup returns zero rows for a customer who must exist.
This is how you catch logical failures, the ones where every node returns green while the business result is wrong.
How to test without waiting for a crash
Manual runs never trigger the handler, so you need an automatic run that is guaranteed to fail. A throwaway test workflow does the job in under two minutes.
- Create a workflow with a Schedule Trigger set to every minute, followed by a Stop and Error node with the message
Test alert. - Set its error workflow to
Error Handlerand publish it. - Wait for the next minute to pass and check your Slack channel.
- Unpublish or delete the test workflow straight away so it stops failing every minute.
To check the Slack formatting on its own, you can execute the handler manually with the sample payload from the docs pinned to the Error Trigger. That proves the message layout, not the link between workflows. If you import workflows from JSON files, run this test after every import; our walkthrough on importing n8n template JSON files explains where those settings live.
Why your error workflow never fires
Almost every case comes down to the run not ending as failed, or the handler not being linked correctly. Work through this table before assuming a bug.
| Symptom | Likely cause | Fix |
|---|---|---|
| Nothing when you click Execute | Manual runs never call the handler | Test with a scheduled or webhook run |
| Run shows as success despite an API error | On Error set to Continue on that node | Switch to Stop Workflow or add Stop and Error |
| Handler fires for some workflows, not others | Error workflow not set on those workflows | Check Options > Settings on each one |
| Workflow created by API never alerts | The errorWorkflow setting holds a name instead of an ID | Pass the handler's workflow ID |
| Handler runs but Slack shows blanks | Trigger failure payload uses trigger{} | Use the Code node above |
| Handler runs but no message arrives | The Slack step itself failed | Open the handler's executions and read its error |
The ID-versus-name problem catches people who generate workflows with scripts or the API. One user on the n8n community forum traced weeks of missing alerts to exactly that.
Where this setup falls short
An error workflow tells you something broke; it does not tell you what data broke it, and it cannot warn you about runs that never started. Plan around those gaps.
- No failing input. The payload names the node, not the record. Open the run from the link and inspect the input there.
- Silence is ambiguous. If n8n itself is down, no error workflow runs, so pair alerts with an external uptime check.
- Same channel risk. If Slack is the thing that failed, a Slack-only handler fails too. Add an email step as a second route for critical workflows.
- Alert fatigue. A workflow that fails every five minutes floods the channel. Fix the root cause or pause the workflow rather than muting alerts.
For that outside check, our Incident Auto-Bridge template routes monitoring alerts into Slack and PagerDuty.
Since n8n 3.3, instances with n8n Assistant enabled show a "Fix with n8n Assistant" prompt on the error toast in the editor. That helps while building, but it does nothing for production runs at 3 a.m., which is the job of the handler.
Our recommendation: build one shared error workflow today, link every published workflow to it, and add Stop and Error wherever a wrong result matters more than a crash. It is the cheapest reliability upgrade available in n8n.
How this was made: researched and written by Mohammad Sayyaf with AI-assisted drafting; facts checked against the linked sources as of December 2026.
Frequently asked questions
What is an error workflow in n8n?
An error workflow is a separate n8n workflow that starts with the Error Trigger node. When a production execution of any workflow linked to it fails, n8n runs it and passes details such as the workflow name, the last node executed, the error message and a link to the run. You can then send those details to Slack, email or a logging sheet so failures never go unnoticed.
Why is my n8n error workflow not triggering?
The usual causes are testing with a manual run, which never calls the handler, or a node set to On Error: Continue, which lets the run finish as a success. Also check that each workflow has the handler selected under Options, Settings, Error workflow, and if you create workflows through the API, pass the handler's workflow ID rather than its name.
Can one error workflow handle all my n8n workflows?
Yes. The n8n documentation says you can use the same error workflow for multiple workflows. Build one handler, publish it, then select it in the Error workflow field of every production workflow. The payload includes the workflow name and ID, so a single Slack channel can still show exactly which automation broke and where.
How do I test an n8n error workflow?
Create a small test workflow with a Schedule Trigger running every minute and a Stop and Error node after it. Link it to your handler, publish it, wait for the next run and check that the alert arrives. Then unpublish or delete the test workflow so it stops failing every minute and flooding your alerts channel.
Does Retry On Fail stop the error workflow from running?
Not permanently. Retry On Fail reruns the failing node first, up to five tries with at most 5,000 ms between them according to the n8n docs. If the final attempt still fails and On Error is set to Stop Workflow, the execution ends as failed and your error workflow runs as normal with the usual payload.
Sources
Put this guide into practice
This Tutorials article on ZeeGrowth is meant to ship with a real workflow, not sit as theory. Open the free template library for a JSON file that matches the process you just read about, or use a browser tool (cron builder, expression helper, UTM builder, webhook tester) while you configure nodes in n8n.
Import the JSON, connect credentials, run one test item, then activate. If you get stuck on auth or hosting, the integrations hub and self-hosting guide cover the usual blockers. Prefer someone else to install it? Template setup help and managed hosting are available, while the templates and tools on this site stay free under the MIT license.
Want us to set it up for you?
We install the workflow on your n8n instance, connect credentials, and leave you with a running automation.
Get setup help