{ "name": "Send Workflow Failure Alerts to LINE", "tags": [ { "id": "0xpEHcJjNRRRMtEj", "name": "lin", "createdAt": "2025-03-12T05:06:24.112Z", "updatedAt": "2025-03-12T05:06:24.112Z" }, { "id": "U1ozjO3iXQZWUyfG", "name": "_Blueprint", "createdAt": "2025-03-12T06:24:40.268Z", "updatedAt": "2025-03-12T06:24:40.268Z" } ], "nodes": [ { "id": "send-workflow-failure-alerts-to-line-0", "name": "Error Trigger", "type": "n8n-nodes-base.errorTrigger", "position": [ -240, -80 ], "parameters": {}, "typeVersion": 1 }, { "name": "Prepare the failure alert", "type": "n8n-nodes-base.code", "typeVersion": 2, "parameters": { "mode": "runOnceForAllItems", "jsCode": "const x=$input.first().json,w=x.workflow??{},e=x.execution??{};if(typeof w.name!=='string'||!w.name)throw Error('Missing workflow name');const url=typeof e.url==='string'&&e.url?e.url:'not available',text='🚨Workflow failed.🚨\\n\\nName: '+w.name+'\\nURL: '+url;if(text.length>5000)throw Error('Failure alert exceeds LINE text limit');return [{json:{to:'YOUR_LINE_DESTINATION_ID',messages:[{type:'text',text}]}}];" }, "id": "send-workflow-failure-alerts-to-line-1" }, { "id": "send-workflow-failure-alerts-to-line-2", "name": "Send the LINE alert", "type": "n8n-nodes-base.httpRequest", "position": [ 40, -80 ], "parameters": { "method": "POST", "url": "https://api.line.me/v2/bot/message/push", "authentication": "genericCredentialType", "genericAuthType": "httpHeaderAuth", "sendBody": true, "specifyBody": "json", "jsonBody": "={{ $json }}", "options": {} }, "typeVersion": 4.2 } ], "active": false, "pinData": {}, "settings": { "executionOrder": "v1" }, "connections": { "Error Trigger": { "main": [ [ { "node": "Prepare the failure alert", "type": "main", "index": 0 } ] ] }, "Prepare the failure alert": { "main": [ [ { "node": "Send the LINE alert", "type": "main", "index": 0 } ] ] } } }