See llms.txt for all machine-readable content.

Back to Templates

Monitor empty successful workflows via the n8n API, Data Tables and Slack

Created by

Created by: Jessy Mariau || fractional-hq
Jessy Mariau

Last update

Last update 2 days ago

Categories

Share


Quick overview

This workflow runs hourly to monitor selected n8n workflows via the n8n API, recording health checks in an n8n Data Table and sending Slack alerts when a workflow succeeds but returns zero items or becomes stale.

How it works

  1. Runs every hour on a schedule.
  2. Loads watchdog thresholds (grace period, alert cooldown, escalation, and instance URL) and reads the list of watched workflow IDs from an n8n Data Table.
  3. For each watched workflow, uses the n8n API to fetch the most recent successful execution and then retrieves that execution’s run data.
  4. Counts how many items the final executed node produced (and totals items across the run) to detect “successful but empty” runs.
  5. Classifies each workflow as HEALTHY, EMPTY, STALE, DARK, or UNREADABLE based on item counts and how long ago the last success occurred, and decides whether an alert is warranted.
  6. Upserts the latest verdict, counters, timestamps, and last execution ID back into the same Data Table, and posts a formatted alert to a Slack channel when the alert rules are met.
  7. Reads the ledger back and posts a separate Slack message if any watched workflows were not checked during the sweep.

Setup

  1. Create an n8n Data Table named workflow_output_watchdog with columns for workflow_id, label, expect_every_minutes, min_items, last_state, consecutive_misses, last_checked_at, last_healthy_at, last_alert_at, last_produced_items, and last_execution_id.
  2. Add one row per workflow you want to monitor, setting workflow_id, expect_every_minutes, and min_items (set min_items to 0 for workflows that can legitimately return no items).
  3. Add an n8n API credential with permission to read executions, and ensure the workflow runs on the same instance it monitors.
  4. Add a Slack credential (access token) and set the target channel (for example #n8n-alerts) in the Slack message steps.
  5. Update the instance URL in the watchdog settings so alerts include clickable links to the workflow and execution pages.

Requirements

  • An n8n API credential with permission to read executions
  • A Slack credential (access token) with permission to post to a channel
  • Data Tables available on your n8n instance

Customization

  • Adjust graceMultiplier to change how far past its schedule a workflow can drift before it counts as stale
  • Tune alertCooldownMinutes and escalateAfterMisses to control how loud a repeat fault gets
  • Swap the Slack nodes for Gmail, Telegram or a plain webhook without touching the logic

Additional info

Built by Fractional HQ (fractionalhq.uk). If you want this customised for your stack or built and handed over working, get in touch at fractionalhq.uk/brief.