{ "kind": "open-flow-workflow", "version": 1, "name": "Send Workflow Failure SMS with Twilio", "content": { "modelVersion": 14, "document": { "bindings": {}, "graph": { "nodes": { "n_a16856d920433242": { "name": "Receive a workflow failure", "kind": "error", "sourceFlowIds": [] }, "n_001e872004461d8c": { "inputs": { "workflow": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_a16856d920433242", "output": "workflow" } ] } }, "name": "Prepare the failure message", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": false, "handle": "workflow" } ], "outputs": [ { "jsonSchema": { "type": "string", "description": "The text body of the outbound message." }, "nullable": false, "handle": "message" } ], "name": "Prepare the failure message", "moduleId": "n_3cd6ce840c927563", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_aa66bebe7d3e6b73": { "inputs": { "to": { "kind": "value", "value": "YOUR_RECIPIENT_NUMBER" }, "from": { "kind": "value", "value": "YOUR_TWILIO_NUMBER" }, "body": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_001e872004461d8c", "output": "message" } ] } }, "name": "Send the SMS", "kind": "task", "task": { "inputs": [ { "description": "The destination phone number in E.164 format.", "jsonSchema": { "type": "string", "description": "The destination phone number in E.164 format." }, "nullable": false, "handle": "to" }, { "description": "The Twilio phone number sending the message.", "jsonSchema": { "type": "string", "description": "The Twilio phone number sending the message." }, "nullable": false, "handle": "from" }, { "description": "The text body of the outbound message.", "jsonSchema": { "type": "string", "description": "The text body of the outbound message." }, "nullable": false, "handle": "body" } ], "outputs": [ { "description": "The Twilio message SID.", "jsonSchema": { "type": "string", "description": "The Twilio message SID." }, "nullable": false, "handle": "messageSid" }, { "description": "The Twilio account SID that owns the message.", "jsonSchema": { "type": [ "string", "null" ], "description": "The Twilio account SID that owns the message." }, "nullable": true, "handle": "accountSid" }, { "description": "The delivery status of the message.", "jsonSchema": { "type": [ "string", "null" ], "description": "The delivery status of the message." }, "nullable": true, "handle": "status" }, { "description": "The destination phone number.", "jsonSchema": { "type": [ "string", "null" ], "description": "The destination phone number." }, "nullable": true, "handle": "to" }, { "description": "The sender phone number.", "jsonSchema": { "type": [ "string", "null" ], "description": "The sender phone number." }, "nullable": true, "handle": "from" }, { "description": "The text body of the message.", "jsonSchema": { "type": [ "string", "null" ], "description": "The text body of the message." }, "nullable": true, "handle": "body" } ], "name": "Send the SMS", "executor": { "kind": "connector", "action": "twilio.send_message" } } } }, "edges": [ { "source": "n_a16856d920433242", "target": "n_001e872004461d8c" }, { "source": "n_001e872004461d8c", "target": "n_aa66bebe7d3e6b73" } ] } }, "modules": { "n_3cd6ce840c927563": { "name": "Prepare the failure message", "imports": [], "source": "export default function workflowFailureSms({workflow}) {\n if(!workflow||typeof workflow.flowId!=='string'||!workflow.flowId||typeof workflow.name!=='string'||!workflow.name)throw Error('Missing workflow identity');\n return {message:`Your workflow with ID: ${workflow.flowId} and name: ${workflow.name} failed to execute.`};\n}\n" } } }, "presentation": { "designer": { "version": 1, "flow": { "direction": "vertical" } } } }