Flows
Building flows
A flow is a chain of API steps on a canvas. Connect nodes, pass values between them, and decide what happens when one fails.
Watch one run
Section titled “Watch one run”Here is a small checkout-smoke flow for a payments API. Run it, then switch scenarios to
see how failures travel through the graph.
- POST /auth/token get_token queued
- POST /payments create_payment queued
- Delay Delay 2s wait_for_settlement queued
- Module verify-refund verify_refund queued
- Press Run flow to stream events.
run_when: always, so it still runs after a failure — unless an input it needs was never produced.
Three things to notice:
- A failure stops the success path. Nodes after a failed step are skipped, not failed.
- Cleanup still runs because it is marked
run_when: always. - Unless it can’t. When
/paymentsfails, there is nopayment_idto delete, so cleanup is skipped and recordsmissing_inputs.
The ten node kinds
Section titled “The ten node kinds”| Node | Use it to… |
|---|---|
| Request | Send an HTTP request, then extract outputs and assert on the response. |
| Delay | Wait a fixed time — for APIs that settle asynchronously. |
| Module | Run another flow as a step. Pass values in, read values back. This is how you reuse flows. |
| Set Variable | Set a value for later nodes. |
| Assert | Check something as its own step. |
| Branch | Take different paths based on a condition. |
| Loop | Repeat part of the flow. |
| Poll | Repeat a request until a condition is met. |
| SSE | Subscribe to a server-sent events stream. |
| Webhook Wait | Wait for matching webhook events while the flow runs. |
The canvas has all ten. The CLI’s flows node add covers request, delay, module, and
webhook_wait; build the rest on the canvas or in a full flow definition.
Edges and run conditions
Section titled “Edges and run conditions”Edges follow either the success or the error path, so a failing request can lead somewhere different from a passing one.
Each node also has a run_when:
| Value | The node runs… |
|---|---|
on_success (default) | only when the path before it succeeded |
always | even after an upstream failure — ideal for cleanup |
A node that does not run is marked skipped. The execution records a skip_reason, plus
missing_inputs when a value it needs was never produced.
Variables
Section titled “Variables”Anything in {{double braces}} gets filled in at run time:
| You write | You get |
|---|---|
{{create_payment.payment_id}} | The payment_id output of node create_payment |
{{BASE_URL}}, {{API_TOKEN}} | Values from the environment |
{{$uuid}}, {{$email}} | Fresh test data from dynamic variables |
Build the same flow from the CLI
Section titled “Build the same flow from the CLI”Everything in the demo above can be scripted. You need:
- a parent flow (
<flow-id>) and a child refund-check flow (<child-flow-id>); BASE_URLandAPI_TOKENpointing at a test API;- a child flow that accepts a
payment_idinput and has a nodecheck_refundwith arefund_statusoutput.
The example API creates payments at POST /payments and returns the ID in $.id.
Give every node an explicit ID so references and edges line up.
1. Create the payment and expose its ID
echopoint flows node add <flow-id> --type request --id create_payment \ --name "Create payment" --method POST --url "{{BASE_URL}}/payments" \ --headers '{"Authorization": "Bearer {{API_TOKEN}}", "Content-Type": "application/json"}' \ --body '{"amount": 4200, "currency": "eur"}'
echopoint flows node output add <flow-id> create_payment \ --name payment_id --extractor json_path --path "$.id"2. Wait, then verify the refund in a child flow
# Delay is in millisecondsechopoint flows node add <flow-id> --type delay --id wait_for_settlement \ --name "Wait for settlement" --duration 2000
echopoint flows node add <flow-id> --type module --id verify_refund \ --name "Verify refund" --flow-id <child-flow-id> \ --input 'payment_id={{create_payment.payment_id}}' \ --output refund_status=check_refund.refund_status3. Connect them
echopoint flows edge add <flow-id> --from create_payment --to wait_for_settlementechopoint flows edge add <flow-id> --from wait_for_settlement --to verify_refund4. Add cleanup that always runs
--after creates the success edge for you.
echopoint flows node add <flow-id> --id cleanup --type request \ --run-when always --after verify_refund \ --name "Delete test payment" --method DELETE \ --url "{{BASE_URL}}/payments/{{create_payment.payment_id}}" \ --headers '{"Authorization": "Bearer {{API_TOKEN}}"}'Check it before CI does
Section titled “Check it before CI does”Validate the structure — every referenced node exists, bindings resolve, edges connect real nodes:
echopoint flows validate <flow-id>Look at the saved flow, definition included, as JSON:
echopoint flow view <flow-id> -o jsonKeep things tidy
Section titled “Keep things tidy”The Flow Library sorts flows into folders. Create a folder, move flows in bulk, or drag
one onto a folder. The CLI has the same thing under flows folder.
Next: Outputs & assertions · Tags & search · Flow history · Echopoint AI