See llms.txt for all machine-readable content.

Back to Templates

Monitor workflow failures via the n8n API and send alerts by email and Slack

Quick overview

This workflow runs hourly to monitor selected n8n workflows via the n8n API, detecting missing executions, recent errors/crashes, and (optionally) successful runs that output zero items, then alerting you by email and optionally posting to Slack.

How it works

  1. Runs every hour on a schedule.
  2. Loads the watchdog configuration, including the workflow IDs to watch, the silent window, and alert settings.
  3. Splits the configured workflow ID list and queries the n8n API for the most recent executions for each workflow.
  4. Analyzes executions to flag workflows with no runs in the configured time window, any recent error/crashed runs, and (optionally) successful runs whose last executed node output zero items.
  5. When issues are found, sends an alert email with a timestamped summary and issue count.
  6. If Slack alerts are enabled, posts the same issue summary to the configured Slack channel.

Setup

  1. Create an n8n API key with at least the execution:list scope (and execution:read if required) and add an n8n API credential with your instance base URL.
  2. Update the configuration values with your comma-separated workflow IDs, silentHours, executionsPerWorkflow limit, and alert email addresses.
  3. Add SMTP credentials for sending alert emails (or replace the email node with your preferred email provider).
  4. If you want Slack alerts, add a Slack OAuth credential and set the target channel ID, or remove the Slack steps if you won’t use them.