{ "kind": "open-flow-workflow", "version": 1, "name": "Send Workflow Failure Alerts to LINE", "content": { "modelVersion": 14, "document": { "bindings": {}, "graph": { "nodes": { "n_33af02d6d1a07437": { "name": "Receive a workflow failure", "kind": "error", "sourceFlowIds": [] }, "n_7266b1b16b513676": { "inputs": { "workflow": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_33af02d6d1a07437", "output": "workflow" } ] }, "execution": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_33af02d6d1a07437", "output": "execution" } ] } }, "name": "Prepare the failure alert", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": false, "handle": "workflow" }, { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": false, "handle": "execution" } ], "outputs": [ { "jsonSchema": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 5000, "description": "A non-empty text message preserved exactly as provided." }, "minItems": 1, "maxItems": 5, "description": "The text messages to send in order." }, "nullable": false, "handle": "texts" } ], "name": "Prepare the failure alert", "moduleId": "n_15b9100eb307337f", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_9aeead98b5c722d6": { "inputs": { "to": { "kind": "value", "value": "YOUR_LINE_DESTINATION_ID" }, "texts": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_7266b1b16b513676", "output": "texts" } ] } }, "name": "Send the LINE alert", "kind": "task", "task": { "inputs": [ { "description": "The target LINE user, group, or room ID.", "jsonSchema": { "type": "string", "minLength": 1, "description": "The target LINE user, group, or room ID." }, "nullable": false, "handle": "to" }, { "description": "The text messages to send in order.", "jsonSchema": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 5000, "description": "A non-empty text message preserved exactly as provided." }, "minItems": 1, "maxItems": 5, "description": "The text messages to send in order." }, "nullable": false, "handle": "texts" }, { "description": "Whether LINE should suppress push notifications for the sent messages.", "jsonSchema": { "type": "boolean", "description": "Whether LINE should suppress push notifications for the sent messages." }, "nullable": true, "handle": "notificationDisabled", "value": null }, { "description": "An optional caller-generated UUID used by LINE to deduplicate a retried request.", "jsonSchema": { "type": "string", "format": "uuid", "description": "An optional caller-generated UUID used by LINE to deduplicate a retried request." }, "nullable": true, "handle": "retryKey", "value": null } ], "outputs": [ { "description": "The accepted LINE messages.", "jsonSchema": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "description": "The message identifier assigned by LINE." }, "quoteToken": { "type": "string", "description": "The token that can be used to quote this message." } }, "required": [ "id" ], "additionalProperties": false, "description": "A message accepted by LINE." }, "description": "The accepted LINE messages." }, "nullable": false, "handle": "sentMessages" } ], "name": "Send the LINE alert", "executor": { "kind": "connector", "action": "line.send_push_text" } } } }, "edges": [ { "source": "n_33af02d6d1a07437", "target": "n_7266b1b16b513676" }, { "source": "n_7266b1b16b513676", "target": "n_9aeead98b5c722d6" } ] } }, "modules": { "n_15b9100eb307337f": { "name": "Prepare the failure alert", "imports": [], "source": "export default function message({workflow,execution}){if(typeof workflow?.name!=='string'||!workflow.name||typeof execution?.runId!=='string'||!execution.runId)throw Error('Missing workflow failure details');const text=`🚨Workflow failed.🚨\\n\\nName: ${workflow.name}\\nRun ID: ${execution.runId}`;if(text.length>5000)throw Error('Failure alert exceeds LINE text limit');return {texts:[text]}}\n" } } }, "presentation": { "designer": { "version": 1, "flow": { "direction": "vertical" } } } }