if-branch-payload-depth.json 1.5 KB

123456789101112131415161718192021222324
  1. {
  2. "name": "verify-if-branch-payload-depth",
  3. "nodes": [
  4. {"id": "n1", "name": "Trigger", "type": "click-trigger", "position": {"x": 0, "y": 0}, "config": {}},
  5. {"id": "src", "name": "Src", "type": "code", "position": {"x": 0, "y": 100},
  6. "config": {"code": "return { count: 2, emails: [{ id: 'a' }, { id: 'b' }] };"}},
  7. {"id": "gate", "name": "Gate", "type": "if-condition", "position": {"x": 0, "y": 200},
  8. "config": {"combineWith": "and", "conditions": [{"field": "data.result.count", "operator": "greater_than", "value": "0"}]}},
  9. {"id": "lp", "name": "Loop", "type": "loop", "position": {"x": 0, "y": 300},
  10. "config": {"inputField": "data.result.emails", "itemVariableName": "email", "outputField": "res", "continueOnError": true}},
  11. {"id": "body", "name": "Body", "type": "code", "position": {"x": 0, "y": 400},
  12. "config": {"code": "return { seen: (input.email && input.email.id) || 'NOT-AN-EMAIL' };"}}
  13. ],
  14. "connections": [
  15. {"sourceNodeId": "n1", "sourceOutput": "main", "targetNodeId": "src", "targetInput": "data"},
  16. {"sourceNodeId": "src", "sourceOutput": "main", "targetNodeId": "gate", "targetInput": "data"},
  17. {"sourceNodeId": "gate", "sourceOutput": "true", "targetNodeId": "lp", "targetInput": "data"},
  18. {"sourceNodeId": "lp", "sourceOutput": "loop", "targetNodeId": "body", "targetInput": "data"}
  19. ],
  20. "expect": {
  21. "lp": {"status": "completed"},
  22. "body": {"status": "completed", "output": {"result": {"seen": "b"}}}
  23. }
  24. }