| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- {
- "name": "verify-call-workflow",
- "nodes": [
- {
- "id": "n1",
- "name": "Trigger",
- "type": "click-trigger",
- "position": {
- "x": 0,
- "y": 0
- },
- "config": {}
- },
- {
- "id": "call",
- "name": "Call",
- "type": "call-workflow",
- "position": {
- "x": 0,
- "y": 100
- },
- "config": {
- "workflowId": "{{helper:sub}}",
- "inputSource": "fields",
- "fields": [
- {
- "name": "n",
- "value": "21"
- }
- ]
- }
- },
- {
- "id": "after",
- "name": "After",
- "type": "code",
- "position": {
- "x": 0,
- "y": 200
- },
- "config": {
- "code": "const d=input.data||input; return { got: d.result, status: d.status };"
- }
- }
- ],
- "connections": [
- {
- "sourceNodeId": "n1",
- "sourceOutput": "main",
- "targetNodeId": "call",
- "targetInput": "data"
- },
- {
- "sourceNodeId": "call",
- "sourceOutput": "main",
- "targetNodeId": "after",
- "targetInput": "data"
- }
- ],
- "expectStatus": "completed",
- "expect": {
- "after": {
- "status": "completed",
- "output": {
- "result": {
- "status": "completed",
- "got": {
- "doubled": 42,
- "label": "unnamed"
- }
- }
- }
- }
- },
- "helpers": [
- {
- "key": "sub",
- "name": "verify sub: double a number",
- "active": true,
- "nodes": [
- {
- "id": "in",
- "name": "Input",
- "type": "workflow-input",
- "position": {
- "x": 0,
- "y": 0
- },
- "config": {
- "fields": [
- {
- "name": "n",
- "type": "number",
- "required": true
- }
- ]
- }
- },
- {
- "id": "calc",
- "name": "Double",
- "type": "code",
- "position": {
- "x": 0,
- "y": 100
- },
- "config": {
- "code": "const d=input.data||input; return { doubled: Number(d.n)*2, label: d.label || \"unnamed\" };"
- }
- },
- {
- "id": "out",
- "name": "Output",
- "type": "workflow-output",
- "position": {
- "x": 0,
- "y": 200
- },
- "config": {
- "source": "fields",
- "fields": [
- {
- "name": "doubled",
- "value": "{{data.result.doubled}}"
- },
- {
- "name": "label",
- "value": "{{data.result.label}}"
- }
- ]
- }
- }
- ],
- "connections": [
- {
- "sourceNodeId": "in",
- "sourceOutput": "main",
- "targetNodeId": "calc",
- "targetInput": "data"
- },
- {
- "sourceNodeId": "calc",
- "sourceOutput": "main",
- "targetNodeId": "out",
- "targetInput": "data"
- }
- ]
- }
- ]
- }
|