| 123456789101112131415161718192021222324252627 |
- {
- "name": "verify-form-submit",
- "nodes": [
- {"id": "n1", "name": "Form", "type": "form-trigger", "position": {"x": 0, "y": 0},
- "config": {"title": "Upload", "responseMode": "wait",
- "fields": [
- {"name": "caption", "label": "Caption", "type": "text"},
- {"name": "image", "label": "Image", "type": "file", "required": true}
- ]}},
- {"id": "n2", "name": "Respond", "type": "respond-to-webhook", "position": {"x": 0, "y": 100},
- "config": {"status": 200, "bodySource": "json",
- "body": "{\"caption\": \"{{$node['Form'].form.caption}}\", \"mime\": \"{{$node['Form'].form.image.mimeType}}\", \"kind\": \"{{$node['Form'].form.image.type}}\", \"size\": {{$node['Form'].form.image.size}}}",
- "contentType": "application/json"}}
- ],
- "connections": [
- {"sourceNodeId": "n1", "sourceOutput": "main", "targetNodeId": "n2", "targetInput": "data"}
- ],
- "http": {
- "method": "POST",
- "path": "/webhook/{workflowId}",
- "multipart": {"fields": {"caption": "a small square"},
- "files": {"image": {"filename": "square.png", "contentType": "image/png"}}},
- "expectStatus": 200,
- "expectBodyContains": ["\"caption\":\"a small square\"", "\"mime\":\"image/png\"", "\"kind\":\"binary\""],
- "expectBodyExcludes": ["\"size\":0"]
- }
- }
|