{ "kind": "open-flow-workflow", "version": 1, "name": "Send a Twake Channel Message", "content": { "modelVersion": 14, "document": { "bindings": {}, "graph": { "nodes": { "n_9d6739e3eb008820": { "name": "Enter channel and message", "kind": "start", "inputDefs": [ { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "channelId" }, { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "content" } ] }, "n_875ccdce4a38e729": { "inputs": { "channelId": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_9d6739e3eb008820", "output": "channelId" } ] }, "content": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_9d6739e3eb008820", "output": "content" } ] } }, "name": "Prepare the message", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "channelId" }, { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "content" } ], "outputs": [ { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": false, "handle": "body" } ], "name": "Prepare the message", "moduleId": "n_44df71b1f8f9312b", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_e3649b076511c4a8": { "inputs": { "url": { "kind": "value", "value": "https://plugins.twake.app/plugins/n8n/actions/message/save" }, "body": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_875ccdce4a38e729", "output": "body" } ] }, "auth.token": { "kind": "unset" } }, "name": "Send to Twake", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "url" }, { "jsonSchema": {}, "nullable": true, "handle": "body" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "auth.token" } ], "outputs": [ { "jsonSchema": {}, "nullable": true, "handle": "body" }, { "jsonSchema": { "type": "integer" }, "nullable": false, "handle": "statusCode" }, { "jsonSchema": { "type": "object", "additionalProperties": { "type": "string" } }, "nullable": false, "handle": "headers" } ], "name": "Send to Twake", "executor": { "method": "POST", "query": { "mode": "fields", "names": [] }, "headers": { "mode": "fields", "names": [] }, "bodyFormat": "json", "authentication": { "type": "bearer" }, "responseFormat": "json", "statusPolicy": "success", "kind": "http-request" } } }, "n_344210c480508a89": { "name": "Message response", "kind": "outputs", "outputDefs": [ { "jsonSchema": {}, "nullable": true, "handle": "response" } ], "outputMappings": { "response": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_e3649b076511c4a8", "output": "body" } ] } } } }, "edges": [ { "source": "n_9d6739e3eb008820", "target": "n_875ccdce4a38e729" }, { "source": "n_875ccdce4a38e729", "target": "n_e3649b076511c4a8" }, { "source": "n_e3649b076511c4a8", "target": "n_344210c480508a89" } ] } }, "modules": { "n_44df71b1f8f9312b": { "name": "Prepare the message", "imports": [], "source": "export default function prepare({channelId,content}){return{body:{object:{channel_id:channelId,content:{formatted:content},hidden_data:{allow_delete:'everyone'}}}};}\n" } } }, "presentation": { "designer": { "version": 1, "flow": { "direction": "vertical" } } } }