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

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

说明与用途

在 n8n 中,错误处理是按工作流可选的,导致覆盖率可能悄无声息地下降,导致长时间未被检测到的故障。作者创建了单一错误处理程序,添加了 SQL 审计查询以检查受保护的工作流,改进了错误消息,并引入了外部心跳检查以检测从未运行的工作流。

问题

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

结果

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.

工作流

  • 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).

证据

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

来源

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

来源

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

来源

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.

来源

  • 记录日期: 2026-10-22T17:11:24.078Z