If you run more than a handful of n8n workflows, you know the problem: a token expires or an API changes a field, the workflow fails quietly, and nobody notices for days.
The obvious fix is an Error Workflow that emails you. The problem with the obvious fix is the first bad night: one broken workflow on a 1-minute schedule sends you 400 identical emails, and after that you start ignoring all of them.
I built an error watchdog that every workflow points to (Workflow settings, Error Workflow). It sends one alert per problem, explains it in plain English with an LLM, and tells you what to check. Here is the part that keeps it quiet.
1. Fingerprint the error, not the execution
Two failures are "the same" if they come from the same workflow, the same node and the same message, ignoring IDs and counters inside the message:
const message = String(err.message || err.description || 'Unknown error').slice(0, 1500);
const node = ex.lastNodeExecuted || err.node?.name || (j.trigger ? 'Trigger' : '');
const fingerprint = wfId + '|' + node + '|' + message.replace(/[0-9a-f]{8,}|\d+/gi, '#').slice(0, 200);
Replacing numbers and long hex strings with # is what collapses "Request failed with status 429 (request id 8f3a91c2...)" and the next one with a different ID into a single fingerprint.
2. Throttle with workflow static data
No database needed. Static data persists between production executions:
const store = $getWorkflowStaticData('global'); store.seen = store.seen || {};
const quiet = (Number(s.quietMinutes) || 60) * 60000;
const now = Date.now();
for (const k of Object.keys(store.seen)) if (now - store.seen[k].at > 7 * 86400000) delete store.seen[k];
const out = [];
for (const item of $input.all()) {
const fp = item.json.fingerprint;
const prev = store.seen[fp];
if (prev && now - prev.at < quiet) { prev.suppressed = (prev.suppressed || 0) + 1; continue; }
out.push({ json: { ...item.json, suppressed_since_last: prev?.suppressed || 0 } });
store.seen[fp] = { at: now, suppressed: 0 };
}
return out;
Two details matter. Old fingerprints are deleted after 7 days so static data does not grow forever. And the suppressed count is carried into the next alert ("this error also happened 37 more times during the quiet period"), so you stay informed without the flood.
3. Make the AI step optional
The LLM node explains the error, ranks likely causes and lists fix steps. If the AI call itself fails, the alert still goes out with a fallback text and the raw error. A monitoring workflow that depends on one more API being up is not much of a monitor.
Gotchas
- n8n only calls the Error Workflow for production (published) runs, not manual runs in the editor. Test with a deliberately failing node in an active workflow.
- Static data is only saved for production executions, so the throttle also only works there.
- The error payload differs between a failed node and a failed trigger (
execution.errorvstrigger.error), so read both.
I packaged the full workflow, with the AI diagnosis and the alert email, as a ready-to-import template: https://nasarhayatt.gumroad.com/l/n8n-error-watchdog
Top comments (0)