{ "kind": "open-flow-workflow", "version": 1, "name": "Post a List of Names to a Webhook", "content": { "modelVersion": 14, "document": { "bindings": {}, "graph": { "nodes": { "n_312bb6f3862c61f1": { "name": "Enter the names", "kind": "start", "inputDefs": [ { "jsonSchema": { "type": "array", "items": { "type": "string" } }, "nullable": false, "handle": "names" } ] }, "n_489aa012097068ca": { "inputs": { "names": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_312bb6f3862c61f1", "output": "names" } ] }, "previous": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_489aa012097068ca", "output": "state" } ] } }, "name": "Prepare the next name", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "array", "items": { "type": "string" } }, "nullable": false, "handle": "names" }, { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": true, "handle": "previous" } ], "outputs": [ { "jsonSchema": { "type": "boolean" }, "nullable": false, "handle": "more" }, { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": false, "handle": "body" }, { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": false, "handle": "state" } ], "name": "Prepare the next name", "moduleId": "n_7f77e43e5b06aea1", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_1a74e79c14f37e9f": { "inputs": {}, "name": "More names?", "kind": "condition", "matchMode": "first", "cases": [ { "output": "yes", "groups": [ { "expressions": [ { "left": { "kind": "source", "source": { "kind": "node", "nodeId": "n_489aa012097068ca", "output": "more" } }, "operator": "isTrue" } ] } ] } ] }, "n_073ea259ea7d28ea": { "inputs": { "url": { "kind": "value", "value": "https://example.com/your-endpoint" }, "body": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_489aa012097068ca", "output": "body" } ] }, "auth.token": { "kind": "unset" } }, "name": "Post the name", "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": { "type": "string" }, "nullable": true, "handle": "body" }, { "jsonSchema": { "type": "integer" }, "nullable": false, "handle": "statusCode" }, { "jsonSchema": { "type": "object", "additionalProperties": { "type": "string" } }, "nullable": false, "handle": "headers" } ], "name": "Post the name", "executor": { "method": "POST", "query": { "mode": "fields", "names": [] }, "headers": { "mode": "fields", "names": [] }, "bodyFormat": "json", "authentication": { "type": "apiKey", "name": "api-key", "in": "header" }, "responseFormat": "text", "statusPolicy": "success", "kind": "http-request" } } } }, "edges": [ { "source": "n_312bb6f3862c61f1", "target": "n_489aa012097068ca" }, { "source": "n_489aa012097068ca", "target": "n_1a74e79c14f37e9f" }, { "source": "n_1a74e79c14f37e9f", "target": "n_073ea259ea7d28ea", "sourceHandle": "yes" }, { "source": "n_073ea259ea7d28ea", "target": "n_489aa012097068ca" } ] } }, "modules": { "n_7f77e43e5b06aea1": { "name": "Prepare the next name", "imports": [], "source": "export default function next({names,previous}){if(!Array.isArray(names)||names.some(x=>typeof x!=='string'||!x.trim()))throw Error('Enter an array of non-empty names');const i=previous?.index??0;if(!Number.isInteger(i)||i<0||i>names.length)throw Error('Invalid iteration');return{more:i