See llms.txt for all machine-readable content.

Back to Templates

Watch output anomalies in workflows with data tables and Slack alerts

Quick overview

A run can finish green and still write zero rows. This workflow stores a receipt from each watched workflow in n8n Data tables, checks them hourly or on demand for silence, low output and counts that do not add up, and posts each finding to Slack once.

How it works

  1. Receives a POST request via webhook (either a receipt payload or an on-demand check request) or runs every hour on a Schedule trigger to perform the same check.
  2. For receipt requests, validates the payload fields (workflowKey, runId, itemsIn, itemsOut, itemsRejected) and rejects invalid receipts with an HTTP 400 response.
  3. Writes valid receipts to an n8n Data Table and returns HTTP 200, or replies HTTP 500 and alerts Slack if the receipt cannot be stored.
  4. For check runs, reads all receipts and existing findings from n8n Data Tables and evaluates each watched workflow for missing receipts (silence), output below a hard floor, output drop versus trailing median, and item conservation mismatches.
  5. Saves new findings to a findings Data Table as unsent rows and queues any previously unsent findings for retry.
  6. Posts a single aggregated alert message to Slack and, only if Slack confirms delivery, marks the corresponding findings as sent in the Data Table.
  7. If the check was started via webhook, returns a JSON check report with HTTP 200 (or HTTP 500 when the check cannot run), while scheduled checks end without a webhook response.

Setup

  1. Create two n8n Data Tables (for example, watchdog_receipts and watchdog_findings) with the required columns used by this workflow (including workflowKey, runId, itemsIn, itemsOut, itemsRejected, receivedAt, findingKey, kind, message, status, foundAt, sentAt) and avoid reserved column names like id, createdAt, or updatedAt.
  2. Add Slack credentials and set the target Slack channel name used for alerts in the Settings values.
  3. Update the Settings values for your receipts/findings table names and configure watchedWorkflows JSON (floors, median thresholds, and cadence hours) to match your monitored workflows.
  4. Copy the webhook production URL and add a final step to each monitored workflow that POSTs its receipt (workflowKey, runId, itemsIn, itemsOut, itemsRejected) to this webhook endpoint.

Requirements

  • An n8n version with Data tables (tested on 2.35.5)
  • A Slack workspace and credential

Additional info

Limits: the webhook URL is public, so add header authentication. Old receipts are never deleted and every check reads the whole receipts table. A workflow is judged only after you add the receipt step to it. Tested with 20 live scenarios against a test Slack workspace; the hourly schedule itself and real time spans were not part of the test.