AutomationFlowsGeneral › Shared Error Handler

Shared Error Handler

shared-error-handler. Uses errorTrigger. Event-driven trigger; 3 nodes.

Event trigger★★★★☆ complexity3 nodesError Trigger
General Trigger: Event Nodes: 3 Complexity: ★★★★☆ Added:

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "active": false,
  "connections": {
    "Build Error Payload": {
      "main": [
        [
          {
            "index": 0,
            "node": "Log Error",
            "type": "main"
          }
        ]
      ]
    },
    "On Error": {
      "main": [
        [
          {
            "index": 0,
            "node": "Build Error Payload",
            "type": "main"
          }
        ]
      ]
    }
  },
  "name": "shared-error-handler",
  "nodes": [
    {
      "id": "1",
      "name": "On Error",
      "parameters": {},
      "type": "n8n-nodes-base.errorTrigger",
      "typeVersion": 1
    },
    {
      "id": "2",
      "name": "Build Error Payload",
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "e1",
              "name": "workflowId",
              "type": "string",
              "value": "={{ $json.workflow?.id }}"
            },
            {
              "id": "e2",
              "name": "workflowName",
              "type": "string",
              "value": "={{ $json.workflow?.name }}"
            },
            {
              "id": "e3",
              "name": "executionId",
              "type": "string",
              "value": "={{ $json.execution?.id }}"
            },
            {
              "id": "e4",
              "name": "errorMessage",
              "type": "string",
              "value": "={{ $json.execution?.error?.message }}"
            },
            {
              "id": "e5",
              "name": "errorNodeName",
              "type": "string",
              "value": "={{ $json.execution?.lastNodeExecuted }}"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4
    },
    {
      "id": "3",
      "name": "Log Error",
      "parameters": {
        "jsCode": "// Stub: in echtem Setup hier Slack-/Email-/Sentry-Notification.\n// DSGVO-Hinweis: keine personenbezogenen Daten ins Log; nur IDs + Workflow-Name + Error-Message.\nconst items = $input.all();\nfor (const item of items) {\n  console.log('[error-handler]', JSON.stringify(item.json));\n}\nreturn items;",
        "language": "javaScript",
        "mode": "runOnceForAllItems"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2
    }
  ],
  "settings": {
    "executionTimeout": 60,
    "saveDataSuccessExecution": "all",
    "saveExecutionProgress": true
  }
}
Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

shared-error-handler. Uses errorTrigger. Event-driven trigger; 3 nodes.

Source: https://github.com/Wagner-Emden-IT-Services/n8n-project-template/blob/main/workflows/shared/error-handler.json — original creator credit. Request a take-down →

More General workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

General

Error Notifier. Uses errorTrigger, httpRequest. Event-driven trigger; 3 nodes.

Error Trigger, HTTP Request
General

QA Kit - Error Handler Starter. Uses errorTrigger. Event-driven trigger; 3 nodes.

Error Trigger
General

Product - Google Search Console API Examples. Uses httpRequest. Event-driven trigger; 36 nodes.

HTTP Request
General

Metavoir Creative Intake To Review Brief. Event-driven trigger; 21 nodes.

General

Retry on fail except for known error Template. Uses stopAndError, noOp, stickyNote, manualTrigger. Event-driven trigger; 19 nodes.

Stop And Error