Your n8n Failure Alert Never Fired: Test the Pager, Not Just the Workflow
Описание и применение
В n8n система оповещений не срабатывала, потому что отслеживала события, а не состояние задач в режиме review. Добавлен запрос к базе, который проверяет состояние, а также тесты доставки в Slack и уменьшение шума.
Задача
Alerting on workflow failures missed jobs that were parked in a review state, and alerts could silently fail to reach the intended channel.
Результат
The system now reliably alerts on jobs stuck in review state, verifies alert delivery, and reduces noise by sending concise, tiered messages.
Рабочий процесс
- 1. Schedule a query on the jobs table to count review rows older than 1 hour. 2. If count > 0, send a page to the alert channel. 3. Run a monthly drill: insert a fake review row, wait for the SLA window, confirm the message appears in Slack, then delete the row and confirm silence. 4. Keep the alert workflow on a separate instance or service to avoid shared failure.
- 5. Include only actionable information (job id, provider, last error, reconciliation handle, link to review row) in the alert message. 6. Tier alerts: urgent actions page immediately; non‑urgent actions go into a daily digest.
Доказательства
I had an alert: n8n's workflow-failure trigger would ping me on Slack whenever a workflow failed.
The first failure was subscribing to the wrong signal. My alert listened for workflow failures. But a job landing in review is not a workflow failure — it is a workflow succeeding at deciding "I don't know."
So I alert on state, not on events. A scheduled sweeper queries the queue itself: SELECT count(*) FROM jobs WHERE state = 'review' AND updated_at < now() - interval '1 hour';
The second failure was the channel itself. Even a correctly triggered alert can die between n8n and your eyes: a rotated Slack webhook token, a channel that got archived...
Put a fake row in review, wait for your SLA window, and check with your own eyes that the message arrived where you actually look.
- Дата записи: 2026-10-22T19:11:19.408Z