Tips > Reliability & Performance

Build a Centralized Error Notification System with the Error Trigger Node

Instead of building error handling into every workflow, create a single **error handler workflow** that receives all errors and routes notifications to the r...

Instead of building error handling into every workflow, create a single error handler workflow that receives all errors and routes notifications to the right channels. Use the Error Trigger node as the starting point, then fan out to Slack, email, PagerDuty, or any alerting system.

Real-world example: A team runs 30 production workflows. Rather than adding Slack notification nodes to each one, they build one error handler that all workflows reference.

Error Handler Workflow:

[Error Trigger] --> [Code: Parse Error] --> [Switch: Severity]
                                               |
                                    +---------+---------+
                                    |         |         |
                                [Critical] [Warning] [Info]
                                    |         |         |
                                [PagerDuty] [Slack]  [Log to DB]
                                    |
                                [Slack: #incidents]
```text
```javascript
// Code node: "Parse Error and Determine Severity"
const errorData = $input.first().json;

const workflowName = errorData.workflow?.name || 'Unknown Workflow';
const errorMessage = errorData.execution?.error?.message || 'No error message';
const lastNode = errorData.execution?.lastNodeExecuted || 'Unknown node';
const executionId = errorData.execution?.id || 'N/A';
const executionUrl = errorData.execution?.url || '';

// Determine severity based on workflow name or error type
let severity = 'info';
const criticalWorkflows = ['Order Processing', 'Payment Handler', 'User Auth'];
const warningPatterns = ['rate limit', 'timeout', '503', '429'];

if (criticalWorkflows.some(w => workflowName.includes(w))) {
  severity = 'critical';
} else if (warningPatterns.some(p => errorMessage.toLowerCase().includes(p))) {
  severity = 'warning';
}

return [{
  json: {
    severity,
    workflowName,
    errorMessage,
    lastNode,
    executionId,
    executionUrl,
    timestamp: new Date().toISOString(),
    slackMessage: [
      `*Workflow Error [${severity.toUpperCase()}]*`,
      `*Workflow:* ${workflowName}`,
      `*Node:* ${lastNode}`,
      `*Error:* ${errorMessage}`,
      `*Execution:* <${executionUrl}|#${executionId}>`,
      `*Time:* ${new Date().toISOString()}`
    ].join('\n')
  }
}];
```text
Slack notification node configuration:

```json
{
  "resource": "message",
  "operation": "post",
  "channel": "#n8n-alerts",
  "text": "={{ $json.slackMessage }}",
  "otherOptions": {
    "mrkdwn": true
  }
}
```text
Point all 30 workflows to this single error handler in their settings. Now you have centralized alerting with severity routing, and adding a new notification channel (e.g., PagerDuty for critical errors) requires changing only one workflow.

**Related:** [Use "Pin Data" to Freeze Node Output](../testing-and-debugging/01-use-pin-data-to-freeze-node-output.md) | [Break Large Workflows into Sub-Workflows](../workflow-architecture/01-break-large-workflows-into-sub-workflows.md)

Showcase builds

19 complete workflows from my own projects, each with its n8n workflow JSON to import. Showcase entries link the file at the end of the article.

See the showcase builds

Keep reading

191 entries grouped by topic, from first workflow to queue mode. Free, no signup.

Browse the encyclopedia

Need it built?

I design, build and run n8n systems for clients. Every engagement starts with a $1,500 diagnostic audit, credited toward the build.

Book a 20-minute call