Starbase / 02 RecipeAgents

RecipeAgents / Guides

Agent recipe guide

n8n error workflow: get an alert when a workflow fails

An n8n error workflow is a second workflow that starts with an Error Trigger node and runs when another workflow's execution fails. Build it once, pick it under Settings > Error workflow in each workflow you want watched, and every failed run sends you the workflow name, the node that failed, the error message and a link to the run. That's the setup in n8n's error-handling docs, read Nov 3, 2026. You can download our handler (three nodes, emails you through Gmail) instead of building it.

What most guides skip is why it looks broken when you test it. The Error Trigger only fires for automatic runs, not for a click on Execute workflow, and it never hears about errors you've already handled inside a workflow. Both are below, with what 365 public n8n templates do about failures.

Step by step

  1. Download error-handler.n8n.json. In n8n, create a workflow, open the ⋯ menu and choose Import from file.
  2. Open the Email me node, connect your Gmail account and replace you@example.com with your address. Name the workflow Error Handler and save it. The docs say a workflow that uses the Error Trigger doesn't have to be published.
  3. Open each workflow you want watched: Workflow menu > Settings > Error workflow > Error Handler > Save. It's set per workflow and one handler can serve many, so a new workflow isn't covered until you do this.
  4. In the same Settings window, leave Save failed production executions on. If failed runs aren't saved, the alert arrives without a run link (see the table below).
  5. Test with an automatic run, not the Execute workflow button: make a throwaway workflow with a Webhook trigger followed by a Stop and Error node, publish it, set Error Handler on it, then open its production webhook URL in a browser. Delete it afterwards.
  6. Decide where alerts go. Email is fine for a handful of workflows; if the Gmail connection itself breaks, the alert has nowhere to go (see the last caveat).
SPONSOR SLOT · AVAILABLEFeature your product here

What the alert receives, and what can be missing

The Error Trigger passes your handler one item. n8n's docs describe two shapes, and our handler reads both:

What failedYou getNot available
A node inside the runworkflow.name, execution.lastNodeExecuted, execution.error.message, execution.mode, and execution.id and execution.urlThe id and url need the failed execution to be saved. retryOf appears only on retries
The trigger node itselfworkflow.name and a trigger block with the error and its nodeNo execution.id or execution.url, because the workflow never started

That second row is why our handler's email says "the trigger itself failed" instead of printing an empty link.

Why your error workflow didn't fire

Four causes, in the order we'd check them:

  1. You tested by hand. The docs say you can't test error workflows by running a workflow manually; the Error Trigger runs only when an automatic run fails. Two forum threads show people hitting this: Error Workflow not Executing and Error workflow can not be triggered. A reply in the second one notes that even a Stop and Error node doesn't fire it in a manual run.
  2. The error was handled. If a node's On Error setting is Continue, or Continue (using error output) with the error branch wired, n8n treats the failure as dealt with. n8n's own error-handling skill notes say this holds even if the branch does nothing, so a failure wired to an empty Set node disappears without an alert. Make the error branch send its own message, or leave On Error on Stop Workflow.
  3. The workflow doesn't point at the handler. The setting is per workflow, so check Settings on every workflow you rely on, including new ones.
  4. It fired, but you can't tell which run. With failed executions not saved, the alert has no id or url, as above.

A related trap from GitHub issue #20980 (Oct 2025): someone tried to activate the handler and got "has no node to start the workflow". n8n's reply was that the docs say you don't need to; the handler runs when the other workflow errors. If a workflow contains an Error Trigger, the docs add, it uses itself as its error workflow by default.

What 365 public templates do about failures

In our study of 13,574 public n8n templates (snapshot 2026-10-20), 365 (2.7%) contain an Error Trigger. It's growing: 4.3% of the templates created in 2026 so far (254 of 5,845) against 1.5% of those from 2025 (100 of 6,564).

They mostly alert in chat or email. Of the 365, 204 (55.9%) contain a Slack node, 181 (49.6%) Gmail and 100 (27.4%) Telegram; 335 (91.8%) contain at least one messaging or email node (Slack, Gmail, Telegram, Send Email, Discord, Twilio, Outlook, Teams, Pushover or Mattermost).

Fewer than 1 in 10 are the standalone handler this page describes. Only 21 (5.8%) have four or fewer node types besides sticky notes. At least 301 (82.5%) also contain another trigger, so they're ordinary workflows carrying their own Error Trigger. By the docs' default that covers just that one workflow; a shared handler covers every workflow you point at it. Separately, 249 templates (1.8%) use Stop and Error to fail on purpose, 13 of them together with an Error Trigger. Counts are of templates containing at least one node of that type, totals only.

Make sure the alert itself can't fail quietly

The handler is a workflow too. If its Gmail connection has expired, the original failure produces an alert that never arrives. n8n's error-handling skill notes make two points worth copying: n8n won't re-trigger an error workflow when the handler itself fails, so that failure goes nowhere, and an error workflow should be fast and avoid calls that can themselves fail. Use a channel your other workflows don't depend on, and once a month break something on purpose (the throwaway test above) to see the alert land.

One alert is sent per failed run. A workflow that runs every minute and starts failing every time will send one email per failure, so for busy workflows send alerts to a Slack channel you can mute rather than your inbox. Per n8n's pricing docs, as quoted in our n8n pricing guide, error workflows don't count toward your execution quota on n8n Cloud.

Where this fits in our recipes

None of our 27 recipe files contains an Error Trigger, by design: the handler is separate, so you attach it to whichever recipe you run. It matters most for the ones where silence looks like success: the bill due reminder (a reminder that never ran), the invoice PDF to sheet recipe and the Telegram AI agent. Scheduled ones also depend on the Schedule Trigger behaving, and Gmail-based ones on the Gmail node.

What we checked: the file imports into n8n 2.44.6, and we ran the Code node's JavaScript against the docs' two sample payloads. We haven't run it live against a failing workflow on a hosted instance, so do the throwaway test in step 5 before you trust it.

Before you use it

Every recipe on RecipeAgents follows the same shape: a trigger, the tools, the steps, and the exact prompt. Start with the human-approval version. Once you have watched a few dozen runs and trust the output, decide which steps can run on their own. Model and tool names change often, so check current pricing and features in each tool before you build.

Frequently asked questions

How do I set up an error workflow in n8n?
Create a workflow whose first node is the Error Trigger, add a notification node such as Gmail or Slack, and save it. Then in each workflow you want watched, open Settings and choose it under Error workflow.
Why is my n8n error workflow not triggering?
The usual causes are a manual test run (the Error Trigger only fires for automatic runs), an error that was handled with a Continue setting on the node, or the handler not being selected in that workflow's settings.
Do I need to activate or publish the n8n error workflow?
No. n8n's docs say a workflow that uses the Error Trigger doesn't have to be published; it runs when a linked workflow fails.
Can one n8n error workflow cover many workflows?
Yes. The docs say you can use the same error workflow for multiple workflows, but you select it in each workflow's settings.
How do I make an n8n workflow fail on purpose?
Add a Stop and Error node. It forces the execution to fail, which triggers the error workflow in an automatic run.

From our sister sites

More guides

Back to all of RecipeAgents

Newsletter

One small automation every Friday

Each Friday email has one recipe, the prompt for it, and the way it broke when we wrote it up. It's free, and every email has an unsubscribe link.