How do I send a Slack alert when an n8n workflow fails?
Create a separate "error workflow" that starts with the Error Trigger node and ends with a Slack node that sends a message, then select it as the Error workflow in the settings of every workflow you want to watch. The alert only fires on automatic (non-manual) runs, so you test it by letting a real or scheduled run fail, not by pressing Execute.
Automation Blueprint — £217.50 one-time. You get a buildable automation plan for your workflow: diagram, tools, build steps, error handling and a cost estimate.
Get Automation Blueprint →
Key takeaways
- The n8n error handling docs say each workflow can have an error workflow, set under Workflow Settings, which runs when an execution fails. It must start with the Error Trigger node, and one error workflow can serve multiple workflows.
- The Error Trigger node docs list the steps: create a workflow with the Error Trigger first, name it something like Error Handler, save it, select it under Options > Settings > Error workflow in each monitored workflow, and publish the workflow that contains the Error Trigger.
- The trigger provides an `execution` object (id, url, retryOf, error message and stack, lastNodeExecuted, mode) and a `workflow` object (id and name). `execution.id` and `execution.url` need the execution to be saved to the database, and are absent if the main workflow's trigger node fails, in which case the payload has a `trigger` object instead.
- It only fires on automatic executions, so you cannot test it by running the workflow manually.
- The Slack node docs say Message > Send posts to a channel using Slack's chat.postMessage method, with credentials by OAuth2 or Access Token. They do not say how to pick the channel or describe rate limits, so check Slack's own docs.
- The Stop and Error node lets you fail on purpose, for example when an API returns an empty body, so the error workflow still alerts you.
Who this is for / who it is not for
This is for you if you run n8n workflows (cloud or self-hosted) that matter, such as lead routing, invoicing or reporting, and you find out about failures late because nobody opens the executions list.
It is not for you if you only use Zapier or Make, which have their own alert features, or if you need alerts for workflows that never start at all, such as a server that is down. An error workflow cannot run if n8n itself is not running, so use an external uptime monitor for that.
Decide first how loud the alert should be. One shared Slack channel for all failures is easy, but gets ignored when it is noisy. Consider sending critical workflows to a person or a separate channel, and keep the message short with a link to the execution.
Automation Blueprint — £217.50 one-time. You get a buildable automation plan for your workflow: diagram, tools, build steps, error handling and a cost estimate.
Get Automation Blueprint →
Describe your automation in plain words and get a diagram, the right tools, build steps and a cost estimate.
What the error workflow receives
| Field | Where it appears | Use in the Slack message |
|---|---|---|
| workflow.name | Always | Which workflow failed |
| execution.error.message | Failure in a later node | What went wrong |
| execution.lastNodeExecuted | Failure in a later node | Which step failed |
| execution.url | If the execution is saved | Link to open the run |
| trigger.error.message | Trigger node failure | Why the trigger failed |
| execution.mode | Always | Whether it was a retry or test |
Source: n8n Error Trigger documentation.
Step by step
- Create the error workflow. New workflow, first node Error Trigger, name it "Error Handler", save.
- Add a Slack node. Choose Message > Send, select your Slack credentials and the channel. If you have not connected Slack yet, create credentials with a Slack app and the scopes listed on n8n's Slack credentials page.
- Write the message using expressions from the trigger data, for example the workflow name, the error message, the last node and the execution link.
- Handle the trigger-failure case. The fields differ when the main trigger fails, so use expressions that fall back to the `trigger` object, or send the raw message text.
- Publish the error workflow. The Error Trigger docs say the workflow with the trigger must be published.
- Attach it to your workflows. In each monitored workflow, open Options > Settings, choose the Error Handler under Error workflow and save.
- Test with a real failure. Add a Stop and Error node to a scratch workflow, point its error workflow setting at the handler, and let a scheduled or webhook run trigger it. Remember manual runs do not fire it.
- Add your own failure conditions with Stop and Error, such as an empty response from an API. See how to handle errors in n8n and Make and how to check an n8n workflow is built properly.
Worked example: a lead-routing workflow
Example, assembled from the documented fields with an invented message. A workflow routes website form leads to a CRM. The owner builds an Error Handler workflow with the nodes below.
| Node | Setting |
|---|---|
| Error Trigger | No configuration |
| Slack, Message > Send | Channel: a private alerts channel |
| Message text | "Workflow failed: {{workflow name}}. Step: {{last node executed}}. Error: {{error message}}. Open the run: {{execution url}}" |
The owner opens the lead-routing workflow, goes to Options > Settings, selects Error Handler and saves. To test, they add a Stop and Error node behind an If node that fires when the CRM response is empty, then submit a test form that triggers the condition. Slack receives the message with the failing step. The owner then adds the same Error Handler to the invoicing and reporting workflows, so one handler serves all three, as the docs allow. The message text and channel are invented to show the method.
Alternatives
- Email instead of Slack. Use the Send Email node in the same error workflow if the team lives in email.
- Zapier or Make. Both have their own alerting. See how to set up error alerts for a Zapier Zap that fails silently.
- External monitoring for the n8n server itself, because an error workflow cannot report that n8n is down.
- Telegram or another channel. n8n has nodes for other apps, using the same error workflow pattern. See how to build a Telegram bot automation in n8n.
- Back up the workflows so a fix is quick. See how to back up your n8n workflows.
Is there a tool that plans an automation, with error handling, before I build it?
Yes. Asendify's Automation Blueprint takes your described workflow and returns a buildable plan: a diagram, the tools, build steps, error handling and a cost estimate. It suits people who want the failure path (what alerts, who gets it, what happens to the data) designed before they open n8n. It is a plan, not a hosted automation, and you still build it yourself or hand it to someone. Free alternatives are the n8n docs above and the community forum. See how to plan an n8n workflow from a plain-English description.
FAQ
Why does my Error Trigger not fire when I test?
It only fires on automatic executions, per the n8n docs. Run the workflow from its trigger or a schedule.
Can one error workflow cover many workflows?
Yes, one error workflow can serve multiple workflows.
Do I need to publish the error workflow?
Yes, the workflow containing the Error Trigger must be published.
What if the trigger node itself fails?
The payload has a `trigger` object with the error details, and `execution.id` and `execution.url` are missing.
Can I make a workflow fail on purpose?
Yes, use the Stop and Error node, which also triggers the error workflow.
Automation Blueprint — £217.50 one-time. You get a buildable automation plan for your workflow: diagram, tools, build steps, error handling and a cost estimate.
Get Automation Blueprint →
More guides on other topics: https://www.asendify.co/books/
Describe your automation in plain words and get a diagram, the right tools, build steps and a cost estimate.