respond-to-webhook.json 1.1 KB

1234567891011121314151617181920212223
  1. {
  2. "name": "verify-respond-to-webhook",
  3. "nodes": [
  4. {"id": "n1", "name": "Webhook", "type": "post-trigger", "position": {"x": 0, "y": 0}, "config": {}},
  5. {"id": "n2", "name": "Respond", "type": "respond-to-webhook", "position": {"x": 0, "y": 100},
  6. "config": {"status": 201, "bodySource": "json", "body": "{\"created\": true, \"id\": \"abc\"}",
  7. "contentType": "application/json", "headers": {"X-Smartbotic-Test": "tier2"}}},
  8. {"id": "n3", "name": "After", "type": "code", "position": {"x": 0, "y": 200},
  9. "config": {"code": "return { ranAfterResponding: true };"}}
  10. ],
  11. "connections": [
  12. {"sourceNodeId": "n1", "sourceOutput": "main", "targetNodeId": "n2", "targetInput": "data"},
  13. {"sourceNodeId": "n2", "sourceOutput": "main", "targetNodeId": "n3", "targetInput": "data"}
  14. ],
  15. "http": {
  16. "method": "POST",
  17. "path": "/webhook/{workflowId}",
  18. "body": {"hello": "world"},
  19. "expectStatus": 201,
  20. "expectHeaders": {"Content-Type": "application/json", "X-Smartbotic-Test": "tier2"},
  21. "expectBodyContains": ["\"created\":true", "\"id\":\"abc\""]
  22. }
  23. }