{ "kind": "open-flow-workflow", "version": 1, "name": "Sum Example Dollar Amounts", "content": { "modelVersion": 14, "document": { "bindings": {}, "graph": { "nodes": { "n_47a2e5c759684433": { "name": "Run the example", "kind": "start", "inputDefs": [] }, "n_08d9a8e0374f7cf7": { "inputs": {}, "name": "Sum the amounts", "kind": "task", "task": { "inputs": [], "outputs": [ { "jsonSchema": { "type": "number" }, "nullable": false, "handle": "total_value" } ], "name": "Sum the amounts", "moduleId": "n_e49660a6db0d9f28", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_1772fd76cf42429b": { "name": "Total value", "kind": "outputs", "outputDefs": [ { "jsonSchema": { "type": "number" }, "nullable": false, "handle": "total_value" } ], "outputMappings": { "total_value": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_08d9a8e0374f7cf7", "output": "total_value" } ] } } } }, "edges": [ { "source": "n_47a2e5c759684433", "target": "n_08d9a8e0374f7cf7" }, { "source": "n_08d9a8e0374f7cf7", "target": "n_1772fd76cf42429b" } ] } }, "modules": { "n_e49660a6db0d9f28": { "name": "Sum the amounts", "imports": [], "source": "export default function sumExample(){const items=[{amount_USD:50},{amount_USD:20},{amount_USD:60}];let total=0;for(const item of items)total+=item.amount_USD;return{total_value:total}}\n" } } }, "presentation": { "designer": { "version": 1, "flow": { "direction": "vertical" } } } }