{ "kind": "open-flow-workflow", "version": 1, "name": "Route Three Example Items by ID", "content": { "modelVersion": 14, "document": { "bindings": {}, "graph": { "nodes": { "n_f7bb46a534ee61e7": { "name": "Run the example", "kind": "start", "inputDefs": [] }, "n_74792b2b2ef66b12": { "inputs": {}, "name": "Route and name items", "kind": "task", "task": { "inputs": [], "outputs": [ { "jsonSchema": { "type": "array", "items": { "type": "object" } }, "nullable": false, "handle": "zero" }, { "jsonSchema": { "type": "array", "items": { "type": "object" } }, "nullable": false, "handle": "one" }, { "jsonSchema": { "type": "array", "items": { "type": "object" } }, "nullable": false, "handle": "two" }, { "jsonSchema": { "type": "array", "items": { "type": "object" } }, "nullable": false, "handle": "other" } ], "name": "Route and name items", "moduleId": "n_7ea36e4456d64d3a", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_0360af308db3b72d": { "name": "Branch results", "kind": "outputs", "outputDefs": [ { "jsonSchema": { "type": "array", "items": { "type": "object" } }, "nullable": false, "handle": "zero" }, { "jsonSchema": { "type": "array", "items": { "type": "object" } }, "nullable": false, "handle": "one" }, { "jsonSchema": { "type": "array", "items": { "type": "object" } }, "nullable": false, "handle": "two" }, { "jsonSchema": { "type": "array", "items": { "type": "object" } }, "nullable": false, "handle": "other" } ], "outputMappings": { "zero": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_74792b2b2ef66b12", "output": "zero" } ] }, "one": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_74792b2b2ef66b12", "output": "one" } ] }, "two": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_74792b2b2ef66b12", "output": "two" } ] }, "other": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_74792b2b2ef66b12", "output": "other" } ] } } } }, "edges": [ { "source": "n_f7bb46a534ee61e7", "target": "n_74792b2b2ef66b12" }, { "source": "n_74792b2b2ef66b12", "target": "n_0360af308db3b72d" } ] } }, "modules": { "n_7ea36e4456d64d3a": { "name": "Route and name items", "imports": [], "source": "export default function routes(){const items=[{id:0},{id:1},{id:2}],zero=[],one=[],two=[],other=[];for(const item of items){if(item.id===0)zero.push({...item,name:'n8n'});else if(item.id===1)one.push({...item,name:'nodemation'});else if(item.id===2)two.push({...item,name:'nathan'});else other.push(item)}return{zero,one,two,other}}\n" } } }, "presentation": { "designer": { "version": 1, "flow": { "direction": "vertical" } } } }