wait-for-approval.json 1.0 KB

12345678910111213141516171819202122
  1. {
  2. "name": "verify-wait-for-approval",
  3. "nodes": [
  4. {"id": "n1", "name": "Trigger", "type": "click-trigger", "position": {"x": 0, "y": 0}, "config": {}},
  5. {"id": "approve", "name": "Approve", "type": "wait-for-approval", "position": {"x": 0, "y": 100},
  6. "config": {"reason": "Approve the test", "expiresIn": 1}},
  7. {"id": "after", "name": "After Approval", "type": "code", "position": {"x": 0, "y": 200},
  8. "config": {"code": "return { sawApproval: input.data.approved === true, note: input.data.note };"}}
  9. ],
  10. "connections": [
  11. {"sourceNodeId": "n1", "sourceOutput": "main", "targetNodeId": "approve", "targetInput": "data"},
  12. {"sourceNodeId": "approve", "sourceOutput": "main", "targetNodeId": "after", "targetInput": "data"}
  13. ],
  14. "resume": {
  15. "waitForStatus": "waiting",
  16. "tokenFrom": "approve",
  17. "payload": {"approved": true, "data": {"note": "looks fine"}}
  18. },
  19. "expect": {
  20. "after": {"status": "completed", "output": {"result": {"sawApproval": true, "note": "looks fine"}}}
  21. }
  22. }