{ "name": "verify-split-aggregate", "nodes": [ {"id": "n1", "name": "Trigger", "type": "click-trigger", "position": {"x": 0, "y": 0}, "config": {}}, {"id": "n2", "name": "Fixture", "type": "code", "position": {"x": 0, "y": 100}, "config": {"code": "return { region: 'EU', orders: [{sku: 'a', tier: 'x'}, {sku: 'b', tier: 'y'}, {sku: 'c', tier: 'x'}] };"}}, {"id": "n3", "name": "Split", "type": "split-out", "position": {"x": 0, "y": 200}, "config": {"inputField": "data.result.orders", "include": "none"}}, {"id": "n4", "name": "Flat", "type": "aggregate", "position": {"x": -100, "y": 300}, "config": {"inputField": "data.items", "outputField": "skus", "fieldToAggregate": "sku"}}, {"id": "n5", "name": "Grouped", "type": "aggregate", "position": {"x": 100, "y": 300}, "config": {"inputField": "data.items", "outputField": "items", "groupBy": "tier"}} ], "connections": [ {"sourceNodeId": "n1", "sourceOutput": "main", "targetNodeId": "n2", "targetInput": "data"}, {"sourceNodeId": "n2", "sourceOutput": "main", "targetNodeId": "n3", "targetInput": "data"}, {"sourceNodeId": "n3", "sourceOutput": "main", "targetNodeId": "n4", "targetInput": "data"}, {"sourceNodeId": "n3", "sourceOutput": "main", "targetNodeId": "n5", "targetInput": "data"} ], "expect": { "n3": {"status": "completed", "output": {"count": 3, "items": [{"sku": "a"}, {"sku": "b"}, {"sku": "c"}]}}, "n4": {"status": "completed", "output": {"count": 3, "skus": ["a", "b", "c"]}}, "n5": {"status": "completed", "output": { "count": 3, "groups": 2, "items": [ {"key": "x", "count": 2, "items": [{"sku": "a"}, {"sku": "c"}]}, {"key": "y", "count": 1, "items": [{"sku": "b"}]} ] }} } }