Skip to main content
Each block below is the shortest useful form of a node or declaration. Every node needs a unique id. Nodes run in document order; declarations can sit anywhere. Follow a heading’s link for every field, the behavior on retry and resume, and common errors.

Document

Procedure document: front matter names the procedure and its inputs and output.
Refer to data with $inputs.policy_number or $named_value.field, build strings with 'Policy {{ $inputs.policy_number }}', and fall back with $a.note ?? "".

Do work

call: run a function or effect declared in the document.
call id=read-policy
invoke: run another published procedure as a child run.
invoke id=send-notice
value: build a typed value without running code.
value id=normalize-approval
agent: start an agent session and wait for its typed result. Read it as $output.value.
agent id=summarize-claim
task: ask people to decide, and wait for an answer that matches the result schema. Read it as $output.value.
task id=approve-payout

Control flow

choice: route on a boolean or a fixed set of values. A case can continue, jump to a section, or complete the run.
choice id=route-decision
repeat: run a section in bounded rounds until a round’s result passes a test.
repeat id=review-notice
for-each: run a section once per item and collect the results in item order.
for-each id=send-notices
parallel: run independent sections at the same time and continue when all finish.
parallel id=check-in-parallel

Wait and finish

wait: pause for a duration, until an instant, until an outside system reports a state, or until a task is answered.
wait id=let-billing-settle
wait id=wait-for-effective-date
complete: end the run and return the declared output.
complete id=finish

Declarations

schema: a named JSON Schema for inputs, outputs, code, tasks and waits.
schema id=policy-ref
secret: a named credential an effect can read. Its value is set in Effective, never in the source.
secret id=policy-admin-token
Functions and effects: the TypeScript a call runs. A function is pure; an effect declares what it may use.
function id=pro-rata-refund input=refund-input result=refund
retry: how many times a function or effect may run, and how long to wait between attempts. Without one, code gets three attempts.
retry id=pas-write-retry
Fragments and modules: split a procedure across files, or reuse a typed block of steps.
fragment id=intake-checks
module id=underwriting-gate

Start runs without a person

Triggers start a published procedure on a schedule, when a file lands in a folder, or when an event happens, such as an email arriving.