Skip to content

Flow Control Tasks

Assign values to the workflow context.

- name: init
type: set
config:
status: active
count: "${ .input.items | length }"
export.as: "."

Conditional branching. Config is an array of when/then pairs with inline steps.

- name: route
type: switch
config:
- when: "${ .status == \"approved\" }"
then:
- name: approve
type: set
config:
result: approved
- default:
- name: fallback
type: set
config:
result: pending
export.as: "."

Iterate over a collection.

- name: process-items
type: for
config:
in: "${ .items }"
each: item
at: idx
do:
- name: handle
type: call:http
config:
method: POST
endpoint:
uri: "${ .item.url }"

Execute branches in parallel.

- name: parallel
type: fork
config:
branches:
- name: branch-a
steps: [...]
- name: branch-b
steps: [...]

Error handling with optional retry.

- name: safe-call
type: try
config:
do:
- name: risky
type: call:http
config:
method: GET
endpoint:
uri: https://unstable-api.example.com
catch:
- name: handle-error
type: set
config:
fallback: true
retry: 2

Throw an error to stop execution.

- name: fail
type: raise
config:
error:
status: 400
message: "Validation failed"

Pause execution for a duration (ISO 8601).

- name: delay
type: wait
config:
duration: "PT5S"