Sheet & Flow
Launch offer: 20% off every product and bundle with code LAUNCH20 until October 14, 2026. Browse the store

n8n Error Alerts That Don't Spam You: Error Trigger + Dedupe (n8n 2.x)

Short on time? The n8n Reliability Workflow Pack ($19) is the finished, tested version of what this tutorial builds.

n8n doesn't tell you when a workflow fails unless you ask it to. The built-in way is an error workflow: a workflow that starts with an Error Trigger node, and that other workflows point to in their settings.

Step 1: Create the error workflow

  1. Create a workflow named Error alert router.
  2. Add an Error Trigger node. It receives the failed workflow's name and ID, the node that failed, the error message and a link to the execution.
  3. Add a Code node that formats the message (below).
  4. Add your alert node: Slack, Discord (HTTP Request to a webhook), Telegram, or Send Email.

Step 2: Format and dedupe

When an API goes down, every run of a scheduled workflow fails, and you get the same alert every five minutes. Workflow static data fixes that by remembering what you've already sent:

const e = $('Error Trigger').first().json;
const wf = e.workflow || {}, ex = e.execution || {}, err = ex.error || (e.trigger || {}).error || {};
const node = (err.node && err.node.name) || ex.lastNodeExecuted || 'unknown node';
const msg = String(err.message || 'Unknown error');
const key = [wf.id, node, msg.replace(/\d{2,}/g, '#').slice(0, 120)].join('|');
const state = $getWorkflowStaticData('global');
state.sent = state.sent || {};
const now = Date.now(), windowMs = 30 * 60 * 1000;
if (state.sent[key] && now - state.sent[key] < windowMs) return [];   // already alerted recently
state.sent[key] = now;
return [{ json: { text: `n8n workflow failed: ${wf.name}\nNode: ${node}\nError: ${msg}\n${ex.url || ''}` } }];

Replacing digits in the key (\d{2,} → #) groups errors that differ only by an order number or timestamp. Returning an empty array stops the workflow, so no alert is sent.

Step 3: Publish it (the n8n 2.x gotcha)

In n8n 2.x the error workflow must be published (active). We tested this on 2.40.6. With an unpublished error workflow, nothing is sent and the log only says:

Calling Error Workflow for "…". Workflow "…" is not active and cannot be executed

After publishing, the same failure produced exactly one alert, and two identical follow-up failures were suppressed.

Step 4: Point your workflows at it

In each workflow, open Workflow settings → Error workflow and choose Error alert router. Do this for your backup and monitoring workflows too.

Test it

Make a throwaway workflow with a Webhook trigger and a Code node containing throw new Error('test'), publish it, and call the webhook URL. Manual test runs from the editor don't trigger error workflows, so you need a production execution.

Done-for-you version

The n8n Reliability Workflow Pack includes this router, ready to import:

  • Slack, Discord, Mattermost, Google Chat, Telegram and email
  • a suppressed-count line ("+12 identical alerts suppressed")

The pack also includes:

  • nightly GitHub and disk backups of all workflows
  • an uptime, keyword and SSL monitor
  • a weekly failed-executions report

Everything was tested on n8n 2.40.6.

Not affiliated with n8n GmbH.

Free tool: n8n Workflow Checker: Pasted Secrets, Open Webhooks, Silent Failures

Written with AI assistance. Every formula, command and number on this page was tested before publishing (see each section). Product links go to our store.