Learn Build Community Opportunities Hosted n8n Blog About Careers Contact Log in

Home / Blog / Fix

Fix

N8n alert when workflow fails

A simple 3-node n8n workflow collects error webhooks and sends a notification. This guide gives the no-credentials workflow, setup steps for self-hosted and cloud, and scaling tips to stop alert storms.

If you need an n8n alert when workflow fails, use a small 3-node collector workflow that accepts a POST from any failed workflow, normalises the error, and forwards a single notification. The workflow uses only the Webhook, Code and HTTP Request nodes, so it works in both self-hosted and n8n Cloud without stored credentials.

Why this happens

n8n runs many workflows, and each one can fail for different reasons: API errors, timeouts, rate limits, bad input, Google Sheets oauth breaks, or transient network issues. When every failing workflow sends its own instant notification you quickly get an alert storm. Also, different instances or containers have no central alarm channel by default, so you need a small aggregator that deduplicates and groups errors.

n8n alert when workflow fails: the 3-node workflow

Below is the exporter you can import or recreate. It uses three nodes, and you do not need to save credentials in n8n. The workflow receives an error POST, formats a single short message, and posts to any HTTP webhook like Slack, Microsoft Teams, or a custom receiver.

  1. Webhook (trigger)

    Add a Webhook node. Set HTTP Method to POST. Set Path to something like n8n-error-collector. This node is the public endpoint your other workflows will POST to when they fail.

  2. Code (transform)

    Add a Code node connected to the Webhook. Use JavaScript to normalise incoming body shapes and produce a concise JSON object. Example code to put in the Code node:

    const p = items[0].json;
    return [{ json: {
      instance: p.instance || p.host || 'unknown',
      workflowName: p.workflowName || p.workflowId || p.name || 'workflow',
      executionId: p.executionId || p.id || null,
      error: (p.error && (p.error.message || p.error)) || p.message || JSON.stringify(p).slice(0,1000),
      ts: new Date().toISOString()
    }}];

    This keeps messages small and consistent, and produces keys used by later nodes.

  3. HTTP Request (notify)

    Add an HTTP Request node to post the formatted JSON to your notification endpoint. Set Method to POST, URL to an incoming webhook URL such as a Slack Incoming Webhook (https://hooks.slack.com/services/XXX) or a simple HTTP receiver you control. Set the body type to JSON and in the body use the transformed fields, for example:

    {
      "text": "[{{ $json.ts }}] n8n error: {{ $json.workflowName }} on {{ $json.instance }}\n{{ $json.error }}\nExecution: {{ $json.executionId }}"
    }

    No credential entry is needed in n8n if you paste the full webhook URL into the URL field. For sensitive targets, keep the URL secret and use n8n credentials instead.

Step-by-step: sending failures from many workflows

  1. Deploy the collector workflow above and enable it. Note the full webhook URL shown by the Webhook node, for example https://your-n8n-host/webhook/n8n-error-collector.
  2. In each workflow you want monitored, add a final error handler that POSTS a small JSON to that collector URL when the workflow fails. There are three ways to do this depending on your n8n setup:
    • If your n8n version has an Error Trigger or per-workflow Error Workflow option, point that to the collector workflow.
    • If not, add an HTTP Request node in the failure branch of your workflow and POST the error details to the collector URL.
    • As a fallback, have an external monitor poll the n8n Executions API and POST failures to the collector. This requires API access.
  3. Test by causing a known failure, confirm the collector receives the POST and that the HTTP Request sends a concise notification to your target channel.

Tool-specific notes and links

  • n8n Cloud and self-hosted: The Webhook node is available on both. Use the same workflow on either. If your instance is behind a load balancer, ensure the webhook path is reachable from the workflows that will POST errors.
  • Slack and Teams: use incoming webhook URLs. Paste the full URL into the HTTP Request node, Method POST, Content Type application/json. For Slack keep messages under 4000 chars to avoid truncation.
  • Make.com and Zapier users: the same central webhook pattern applies. In Make.com build a scenario that posts to the n8n collector webhook. In Zapier use a Webhooks by Zapier action to POST JSON to the collector.
  • If you see Google Sheets oauth errors often, consider our guide to fixing that specific issue: Fix google sheets oauth error in n8n.

How to stop alert storms and scale across instances

  • Deduplicate: In the Code node calculate a short signature hash from workflowName and the first 200 characters of error. Store recent hashes in a small cache or in-memory map in a separate workflow and suppress repeats for a window (eg 10 minutes).
  • Group and batch: Instead of one message per failure, buffer errors for 1 to 5 minutes and send grouped summaries. This reduces notifications when a dependent API is down.
  • Severity and thresholds: Only forward errors that include specific keywords or HTTP status codes you care about. For transient 429 or 502 errors count and only alert after N occurrences.
  • Central aggregator per organisation: Run one collector per organisation or team, and point all instances there. For multi-instance setups use a DNS name that rounds to the right collector. If you need higher throughput run the collector on a dedicated n8n worker.
  • Backoff and silence windows: Add silence windows in working hours or during maintenance. Provide a manual mute switch in your aggregator workflow.

When to get help

If a single workflow keeps failing and your collector shows repeated errors, debug that workflow first, look for failing API responses and check credentials. If you prefer community help, see the free thread with an example collector workflow on the n8n forum: Free workflow: get alerted when ANY n8n workflow fails. For paid diagnostics people also post offers such as this thread: For hire: diagnosis for one failing n8n workflow.

If you need a hand building the collector or setting dedupe and batching rules, reach out to a consultant or bring the issue to our Automate Naija community for practical help.

Learn to build automations like this with Automate Naija.

Frequently asked questions

Can this 3-node collector work on n8n Cloud and self-hosted?

Yes. The pattern uses a Webhook node to receive POSTs, a Code node to normalise the payload, and an HTTP Request node to forward notifications. Both n8n Cloud and self-hosted support these nodes. Ensure the webhook URL is reachable from the workflows that will send errors.

How do I make all my workflows send errors to the collector without editing each one?

If your n8n version supports a global Error Workflow or an Error Trigger node, point that to the collector. If not, add a small error branch in each workflow that POSTs the error JSON to the collector webhook, or use an external monitor to poll the Executions API and forward failures.

How do I avoid duplicate alerts for the same issue?

Deduplicate at the collector by hashing the workflow name plus a core part of the error text, then suppress identical hashes for a time window (for example 10 minutes). Alternatively batch similar errors and send a grouped summary every few minutes.

What if the collector itself fails or gets overwhelmed?

Run the collector on a dedicated n8n worker, add basic retry and exponential backoff in the sending node, and implement batching to reduce throughput. Also add health checks or an external uptime monitor so you know when the aggregator is down.


Build it with us. The community is free and the build track teaches this kind of automation week by week: see pricing or join the community.

Keep reading

A new fix lands here every morning, picked from what builders are stuck on right now.