Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

n8n's Error Trigger Is Opt-In. My Bot Gate Failed for 71 Hours and Alerted Nobody.

Description and use

In n8n, error handling is opt‑in per workflow, so coverage can silently decay, leading to long‑unnoticed failures. The author created a single error handler, added a SQL audit query for guarded workflows, improved error messages, and introduced an external heartbeat check to detect workflows that never run.

Problem

Error handling in n8n is opt‑in per workflow, so coverage decays silently and critical failures can go unnoticed for days.

Outcome

The audit query and single shared error handler reduced silent failure windows from 70.9 hours to near‑real‑time alerts, while the heartbeat monitor added detection of workflows that never start.

Workflow

  • Create one Error Trigger workflow that formats {{ $json.workflow.name }}, {{ $json.execution.id }}, and {{ $json.execution.error.message }} into an alert.
  • Run the provided SQL query against the n8n Postgres database (or the Cloud API) to list workflows where settings.errorWorkflow is null or empty.
  • Add the Error Trigger workflow as the error handler for each guarded workflow via Settings → Error Workflow.
  • Modify alert messages to include the workflow name in the subject line for clearer identification.
  • Deploy a separate heartbeat workflow or external cron that pings a monitoring endpoint every run; if the ping fails or is not received within 60 minutes, send a notification.
  • Use the heartbeat to detect when a workflow stops running entirely (e.g., deactivated trigger, dead cron, or worker failure).

Evidence

Error handling in n8n is opt‑in per workflow, so coverage decays silently and critical failures can go unnoticed for days.

Source

I pulled the failures of my own internal workflows, grouped by workflow, with a column for whether that workflow had an error handler attached:

Source

The query is now the first line of my weekly runbook, next to the backup check.

Source

That is the whole value proposition of the Error Trigger, and it is not "fewer failures." It is failures that end in hours instead of days.

Source

  • Record date: 2026-10-22T17:11:24.078Z