{ "nodes": [ { "id": "notify-workflow-failures-on-slack-0", "name": "Slack", "type": "n8n-nodes-base.slack", "position": [ 740, 300 ], "parameters": { "text": "={{ $json.message }}", "select": "channel", "channelId": { "__rl": true, "mode": "id", "value": "YOUR_SLACK_CHANNEL_ID" }, "otherOptions": {} }, "typeVersion": 2.1 }, { "id": "notify-workflow-failures-on-slack-1", "name": "On Error", "type": "n8n-nodes-base.errorTrigger", "position": [ 220, 300 ], "parameters": {}, "typeVersion": 1 }, { "id": "notify-workflow-failures-on-slack-2", "name": "Set message", "type": "n8n-nodes-base.set", "position": [ 480, 300 ], "parameters": { "values": { "string": [ { "name": "message", "value": "={{ (() => { const esc = v => String(v ?? 'not available').replace(/&/g,'&').replace(//g,'>'); const e=$json.execution || {}; return 'Workflow: '+esc($json.workflow?.name)+'\\nExecution URL: '+esc(e.url)+'\\nLast node: '+esc(e.lastNodeExecuted)+'\\nError: '+esc(e.error?.message); })() }}" } ] }, "options": {}, "keepOnlySet": true }, "typeVersion": 1 }, { "id": "notify-workflow-failures-on-slack-3", "name": "Sticky Note3", "type": "n8n-nodes-base.stickyNote", "position": [ 140, 100 ], "parameters": { "color": 5, "width": 424.4907862645661, "height": 154.7766688696994, "content": "### 👨‍🎤 Setup\n1. Add Slack creds\n2. Add this error workflow to other workflows\nhttps://docs.n8n.io/flow-logic/error-handling/#create-and-set-an-error-workflow" }, "typeVersion": 1 }, { "id": "notify-workflow-failures-on-slack-4", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [ 480, 480 ], "parameters": { "width": 241, "height": 80, "content": "### 👆🏽 Adjust error message here" }, "typeVersion": 1 } ], "pinData": {}, "connections": { "On Error": { "main": [ [ { "node": "Set message", "type": "main", "index": 0 } ] ] }, "Set message": { "main": [ [ { "node": "Slack", "type": "main", "index": 0 } ] ] } }, "name": "Notify Workflow Failures on Slack", "active": false }