wait-for-approval-loop-chained.json 1.3 KB

1234567891011121314151617181920212223
  1. {
  2. "name": "verify-wait-for-approval-rejects-chained-loop",
  3. "nodes": [
  4. {"id": "n1", "name": "Trigger", "type": "click-trigger", "position": {"x": 0, "y": 0}, "config": {}},
  5. {"id": "items", "name": "Items", "type": "code", "position": {"x": 0, "y": 100},
  6. "config": {"code": "return { items: [1, 2] };"}},
  7. {"id": "loop", "name": "Loop", "type": "loop", "position": {"x": 0, "y": 200},
  8. "config": {"inputField": "data.result.items"}},
  9. {"id": "pass", "name": "Pass Through", "type": "code", "position": {"x": 0, "y": 300},
  10. "config": {"code": "return { item: input.item };"}},
  11. {"id": "approve", "name": "Approve", "type": "wait-for-approval", "position": {"x": 0, "y": 400},
  12. "config": {"reason": "Should never pause", "expiresIn": 1}}
  13. ],
  14. "connections": [
  15. {"sourceNodeId": "n1", "sourceOutput": "main", "targetNodeId": "items", "targetInput": "data"},
  16. {"sourceNodeId": "items", "sourceOutput": "main", "targetNodeId": "loop", "targetInput": "data"},
  17. {"sourceNodeId": "loop", "sourceOutput": "loop", "targetNodeId": "pass", "targetInput": "data"},
  18. {"sourceNodeId": "pass", "sourceOutput": "main", "targetNodeId": "approve", "targetInput": "data"}
  19. ],
  20. "expect": {
  21. "approve": {"status": "failed", "errorContains": "cannot pause inside a Loop body"}
  22. }
  23. }