{ "kind": "open-flow-workflow", "version": 1, "name": "Match Greetings by Language", "content": { "modelVersion": 14, "document": { "bindings": {}, "graph": { "nodes": { "n_fd7d65824e5646f7": { "name": "Run the example", "kind": "start", "inputDefs": [] }, "n_e23bd9b05771b9c0": { "inputs": { "people": { "kind": "value", "value": [ { "name": "Stefan", "language": "de" }, { "name": "Jim", "language": "en" }, { "name": "Hans", "language": "de" } ] }, "greetings": { "kind": "value", "value": [ { "greeting": "Hello", "language": "en" }, { "greeting": "Hallo", "language": "de" } ] } }, "name": "Match by language", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "array", "items": { "type": "object", "additionalProperties": true } }, "nullable": false, "handle": "people" }, { "jsonSchema": { "type": "array", "items": { "type": "object", "additionalProperties": true } }, "nullable": false, "handle": "greetings" } ], "outputs": [ { "jsonSchema": { "type": "array", "items": { "type": "object", "additionalProperties": true } }, "nullable": false, "handle": "matches" } ], "name": "Match by language", "moduleId": "n_9577a3cae5a02c1f", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_e446cbd8d3c30a44": { "name": "Matched greetings", "kind": "outputs", "outputDefs": [ { "jsonSchema": { "type": "array", "items": { "type": "object", "additionalProperties": true } }, "nullable": false, "handle": "matches" } ], "outputMappings": { "matches": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_e23bd9b05771b9c0", "output": "matches" } ] } } } }, "edges": [ { "source": "n_fd7d65824e5646f7", "target": "n_e23bd9b05771b9c0" }, { "source": "n_e23bd9b05771b9c0", "target": "n_e446cbd8d3c30a44" } ] } }, "modules": { "n_9577a3cae5a02c1f": { "name": "Match by language", "imports": [], "source": "export default function match({people,greetings}){return{matches:people.flatMap(person=>person.language===undefined?[]:greetings.filter(g=>g.language!==undefined&&g.language===person.language).map(g=>({...person,...g})))}}\n" } } }, "presentation": { "designer": { "version": 1, "flow": { "direction": "vertical" } } } }