merge.json 1.1 KB

123456789101112131415161718192021
  1. {
  2. "name": "verify-merge",
  3. "nodes": [
  4. {"id": "n1", "name": "Trigger", "type": "click-trigger", "position": {"x": 0, "y": 0}, "config": {}},
  5. {"id": "a", "name": "BranchA", "type": "code", "position": {"x": -100, "y": 100},
  6. "config": {"code": "return [{id: 1, name: 'one'}, {id: 2, name: 'two'}];"}},
  7. {"id": "b", "name": "BranchB", "type": "code", "position": {"x": 100, "y": 100},
  8. "config": {"code": "return [{id: 2, extra: 'from-b'}, {id: 3, name: 'three'}];"}},
  9. {"id": "m", "name": "Merge", "type": "merge", "position": {"x": 0, "y": 220},
  10. "config": {"mode": "combine-by-key", "key": "id", "path1": "result", "path2": "result"}}
  11. ],
  12. "connections": [
  13. {"sourceNodeId": "n1", "sourceOutput": "main", "targetNodeId": "a", "targetInput": "data"},
  14. {"sourceNodeId": "n1", "sourceOutput": "main", "targetNodeId": "b", "targetInput": "data"},
  15. {"sourceNodeId": "a", "sourceOutput": "main", "targetNodeId": "m", "targetInput": "input1"},
  16. {"sourceNodeId": "b", "sourceOutput": "main", "targetNodeId": "m", "targetInput": "input2"}
  17. ],
  18. "expect": {
  19. "m": {"status": "completed", "output": {"count": 3}}
  20. }
  21. }