Skip to content

Steps and Actions

steps is an ordered list. Each element is a step: a map with exactly one key, which is the step’s id. The value is the step body — an action call, or one of the constructs of value and render, control flow, and code and agents.

An action call names connector.action and supplies its arguments:

- ticket:
helpdesk.new_ticket:
queue: tier1
subject: "{{ message.subject }}"

Implementations MUST validate arguments against the manifest’s input schema: required fields present, no unknown fields, and types and enums satisfied.

Steps execute in list order. The order of declaration is the order of execution. There is no separate dependency declaration, and implementations MUST NOT reorder steps.

Body kind Binds
action call the action’s declared output — a value
value the evaluated structure — a value
render the rendered string, or a map of part name to rendered string — a value
run the value that the sandboxed code returned
agent a value that satisfies the declared returns schema
call the callee’s outputs projection — a value
route, choose the scope of the branch that executed
for_each, repeat a list of iteration scopes, indexed by position
parallel a scope whose members are the branch scopes, named by branch
wait_for a scope with the members status and event
wait, stop nothing readable

A path into the id of a wait step or a stop step is a validation error. Both still take an id, which names the step in the run record.

A step body MAY include the following modifier keys beside its body. Each modifier is permitted only on the body kinds that the table names.

Key Meaning Permitted on
when Guard expression every body kind
timeout Wall-clock limit for the step action call, run, agent, call, for_each, parallel, repeat
retry Overrides the manifest’s default retry policy action call, run
idempotency_key Expression producing the key that the action’s idempotency parameter receives action call
must_succeed Failure is not subject to an enclosing policy action call, run, agent, call, route, choose, for_each, parallel, repeat
optional Failure is recorded, and the run continues the same kinds as must_succeed
undo Compensating action action call
on_unknown Behavior on an ambiguous outcome action call
reconcile Reconciliation that determines the true outcome action call
connection Overrides the environment’s default connection for this connector action call
recovery Scope recovery policy route, choose, for_each, parallel, repeat

Implementations MUST reject a modifier on a body kind that the table does not name. Implementations MUST reject a step that declares both optional and must_succeed.

A construct’s own keys are part of the body, and are not modifiers. with, match, code, network, cases, else, then, steps, as, max, concurrency, on_error, for, until, every, goal, tools, returns, budget, and on_exhausted are construct keys. The section that defines each construct states which of them it takes.

timeout accepts a literal duration or an expression that yields one. wait and wait_for do not accept the timeout modifier, because timeout is a key of the wait_for construct itself.