{ "kind": "open-flow-workflow", "version": 1, "name": "Rocket.Chat Message Sender", "content": { "modelVersion": 14, "document": { "bindings": {}, "graph": { "nodes": { "n_ffb02dc2ba2748be": { "name": "Enter Rocket.Chat message", "kind": "start", "inputDefs": [ { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "roomId" }, { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "text" } ] }, "n_4f3b20c39b638268": { "inputs": { "roomId": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_ffb02dc2ba2748be", "output": "roomId" } ] }, "text": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_ffb02dc2ba2748be", "output": "text" } ] } }, "name": "Post Rocket.Chat message", "kind": "task", "task": { "inputs": [ { "description": "The room ID, channel name, or username target. Channel names must include the # prefix and usernames can use @.", "jsonSchema": { "type": "string", "minLength": 1, "description": "The room ID, channel name, or username target. Channel names must include the # prefix and usernames can use @." }, "nullable": false, "handle": "roomId" }, { "description": "The message text to send.", "jsonSchema": { "type": "string", "description": "The message text to send." }, "nullable": true, "handle": "text", "value": null }, { "description": "Whether Rocket.Chat should generate URL previews.", "jsonSchema": { "type": "boolean", "description": "Whether Rocket.Chat should generate URL previews." }, "nullable": true, "handle": "parseUrls", "value": null }, { "description": "Display alias for the message when the user has impersonation permission.", "jsonSchema": { "type": "string", "description": "Display alias for the message when the user has impersonation permission." }, "nullable": true, "handle": "alias", "value": null }, { "description": "Avatar URL for the message when the user has impersonation permission.", "jsonSchema": { "type": "string", "format": "uri", "description": "Avatar URL for the message when the user has impersonation permission." }, "nullable": true, "handle": "avatar", "value": null }, { "description": "Emoji avatar for the message when the user has impersonation permission.", "jsonSchema": { "type": "string", "description": "Emoji avatar for the message when the user has impersonation permission." }, "nullable": true, "handle": "emoji", "value": null }, { "description": "Message attachments.", "jsonSchema": { "type": "array", "items": { "type": "object", "properties": { "audio_url": { "type": "string", "format": "uri", "description": "Audio URL for the attachment." }, "author_icon": { "type": "string", "format": "uri", "description": "Icon URL displayed next to the author name." }, "author_link": { "type": "string", "format": "uri", "description": "URL linked from the author name." }, "author_name": { "type": "string", "description": "Attachment author name." }, "collapsed": { "type": "boolean", "description": "Whether the attachment should render collapsed." }, "color": { "type": "string", "description": "Attachment accent color." }, "fields": { "type": "array", "items": { "type": "object", "properties": { "title": { "type": "string", "minLength": 1, "description": "The attachment field title." }, "value": { "type": "string", "description": "The attachment field value." }, "short": { "type": "boolean", "description": "Whether this field should be displayed as a short field." } }, "required": [ "title", "value" ], "additionalProperties": false, "description": "Rocket.Chat attachment field." }, "description": "Attachment fields." }, "image_url": { "type": "string", "format": "uri", "description": "Image URL for the attachment." }, "message_link": { "type": "string", "format": "uri", "description": "URL linked from the attachment timestamp." }, "text": { "type": "string", "description": "Attachment text." }, "thumb_url": { "type": "string", "format": "uri", "description": "Thumbnail URL for the attachment." }, "title": { "type": "string", "description": "Attachment title." }, "title_link": { "type": "string", "format": "uri", "description": "URL linked from the attachment title." }, "title_link_download": { "type": "boolean", "description": "Whether title_link should download when clicked." }, "ts": { "type": "string", "description": "Attachment timestamp string." }, "video_url": { "type": "string", "format": "uri", "description": "Video URL for the attachment." } }, "additionalProperties": true, "description": "Rocket.Chat message attachment." }, "description": "Message attachments." }, "nullable": true, "handle": "attachments", "value": null }, { "description": "The original message ID for a thread reply.", "jsonSchema": { "type": "string", "minLength": 1, "description": "The original message ID for a thread reply." }, "nullable": true, "handle": "tmid", "value": null }, { "description": "Custom message fields configured by the workspace.", "jsonSchema": { "type": "object", "properties": {}, "additionalProperties": true, "description": "Custom message fields configured by the workspace." }, "nullable": true, "handle": "customFields", "value": null } ], "outputs": [ { "description": "Rocket.Chat message object returned by the API.", "jsonSchema": { "type": "object", "properties": { "_id": { "type": "string", "minLength": 1, "description": "The Rocket.Chat message ID." }, "rid": { "type": "string", "minLength": 1, "description": "The room ID that owns the message." }, "msg": { "type": "string", "description": "The message text." } }, "additionalProperties": true, "description": "Rocket.Chat message object returned by the API." }, "nullable": false, "handle": "message" }, { "description": "Whether Rocket.Chat reported success.", "jsonSchema": { "type": "boolean", "description": "Whether Rocket.Chat reported success." }, "nullable": false, "handle": "success" } ], "name": "Post Rocket.Chat message", "executor": { "kind": "connector", "action": "rocket_chat.post_message" } } }, "n_1f457529cdf15f2f": { "inputs": { "message": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_4f3b20c39b638268", "output": "message" } ] }, "success": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_4f3b20c39b638268", "output": "success" } ] } }, "name": "Confirm Rocket.Chat message", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "object", "properties": { "_id": { "type": "string", "minLength": 1, "description": "The Rocket.Chat message ID." }, "rid": { "type": "string", "minLength": 1, "description": "The room ID that owns the message." }, "msg": { "type": "string", "description": "The message text." } }, "additionalProperties": true, "description": "Rocket.Chat message object returned by the API." }, "nullable": false, "handle": "message" }, { "jsonSchema": { "type": "boolean", "description": "Whether Rocket.Chat reported success." }, "nullable": false, "handle": "success" } ], "outputs": [ { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": false, "handle": "message" } ], "name": "Confirm Rocket.Chat message", "moduleId": "n_b4f3d4e1add44844", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_8cc3733872fd3b07": { "name": "Sent Rocket.Chat message", "kind": "outputs", "outputDefs": [ { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": false, "handle": "message" } ], "outputMappings": { "message": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_1f457529cdf15f2f", "output": "message" } ] } } } }, "edges": [ { "source": "n_ffb02dc2ba2748be", "target": "n_4f3b20c39b638268" }, { "source": "n_4f3b20c39b638268", "target": "n_1f457529cdf15f2f" }, { "source": "n_1f457529cdf15f2f", "target": "n_8cc3733872fd3b07" } ] } }, "modules": { "n_b4f3d4e1add44844": { "name": "Confirm Rocket.Chat message", "imports": [], "source": "function readRocketMessage(message, success) {\n if (success !== true || !message || typeof message !== 'object' || Array.isArray(message) || typeof message._id !== 'string' || message._id.length === 0 || typeof message.rid !== 'string' || message.rid.length === 0 || typeof message.msg !== 'string') throw new Error('Rocket.Chat did not confirm a sent message');\n return message;\n}\nexport default function rocketChatResult({ message, success }) {\n return { message: readRocketMessage(message, success) };\n}\n" } } }, "presentation": { "designer": { "version": 1, "flow": { "direction": "vertical" } } } }