Silent failures are the worst kind of automation bug: a cron fires, a node errors, and nobody notices for days.
The cheapest fix I know is a single global error workflow that catches a failure in any workflow and tells you about it.
How it works - 3 nodes, no credentials needed:
On Workflow Failure (Error Trigger) - lives in its own workflow. Set it once as your instance’s Error Workflow (Settings → Error Workflow).
Build Alert (Code) - pulls out the workflow name, the failing node, the error message and a link to the failed execution.
Send Alert (HTTP Request) - POSTs the alert to any Slack-compatible webhook.
After this, every failing workflow tells you what broke, where, and links you straight to the execution.
Setup (about 2 minutes):
- Import the JSON at the bottom.
- Open
Send Alert and replace the placeholder URL with your Slack / Discord / Teams webhook.
- On every workflow you care about, set this one as its Error Workflow.
- Break a step on purpose once, to confirm the alert actually arrives.
The bit people usually get wrong is that the Error Trigger receives a nested payload, so the field extraction looks like this:
const input = $input.first().json;
const workflow = input.workflow || {};
const execution = input.execution || {};
const error = execution.error || {};
const wfName = workflow.name || 'unknown workflow';
const nodeName = (error.node && error.node.name) || execution.lastNodeExecuted || 'unknown node';
const errMsg = error.message || error.description || 'unknown error';
const execUrl = execution.url || null;
Full importable workflow:
Two easy variations: swap the HTTP node for an email/Telegram node if you don’t use Slack, and filter in Build Alert to ignore known-noisy workflows so you don’t get alert fatigue.
What do you always want in a failure alert? I need the workflow name, the failing node and the execution link - but I know people add attempt counts and customer IDs too.
One field I’d add is the business reference (lead/order ID), plus whether the failed step may already have written to the external system. A timeout after a create call is the risky one , blindly retrying can create a duplicate
I’d also deliberatly break the alert webhook once. If that POST fails, the original error may still go unseen,And Error Trigger won’t catch a scheduled workflow that never started, so I’d check expected runs separately
Both are worth adding, but they need different plumbing:
1. Business reference — the Error Trigger payload only contains n8n’s own fields (workflow, execution, error), so a lead/order ID isn’t there unless you deliberately put it there. The mechanism n8n gives you for this is custom execution data: in the main workflow, right before the risky step, call $execution.customData.set('ref', <lead/order id>) (and maybe a stage label). Build Alert then just echoes whatever the run attached, so the error workflow stays generic.
2. “Did the failed step already write to the external system?” — honestly an alert can’t answer that, and it’s risky to pretend it can. The HTTP call may already have committed on the remote side before the error surfaced (the classic at-least-once problem). Two ways to make it safe:
- Make the write idempotent — upsert keyed on the same ref, or send an
Idempotency-Key header. Then a blind retry is harmless.
- Log the remote response id (e.g. the created record id) next to the ref, so on failure you reconcile by looking it up instead of re-creating.
Note that execution.lastNodeExecuted tells you where it stopped, not whether the side effect committed — so treat any failure after a write as “unknown, assume yes”.
Net: attach the ref + remote id at the point of the write, make writes idempotent, and let the alert carry those fields through. Then filtering out known-noisy workflows (alert fatigue) is a one-liner in Build Alert.
leveraging global error triggers with lightweight alert routing is one of the easiest ways to safeguard self-hosted n8n setups.
attaching execution metadata like workflow name and node retry counts directly to the alert payload makes diagnosing production failures immediate.