docs / Reference / Definition language
Task
A task, the routing that follows it, and the value it publishes.
Task
| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes | Task identifier, unique within the definition. |
switch | Switch | yes | Required. Routing: a shorthand (“next”, “end”, “$task-id”) or an ordered list of cases. |
action | Action | Describes the action to perform. Omit for switch-only (routing) tasks. | |
on_error | Error rule[] | Ordered error-routing rules evaluated when the call fails. First match wins. | |
only_once | boolean | At-most-once execution: only errors that never reached the remote may retry. Defaults to false. | |
output | Shape | Templated value remapping this task’s output; it becomes outputs.taskID and self.output. | |
output_schema | JSON Schema | JSON Schema this task’s output is checked against and conformed to. It becomes the published type of outputs.taskID. |
Switch
The value of a task’s switch.
string
A single unconditional route: “next”, “end”, or “$task-id”.
object[]
Ordered routing rules; first match wins and the last must be a catch-all (omit ‘case’).
Each element:
| Field | Type | Required | Description |
|---|---|---|---|
case | string | Boolean expression. Omit for a catch-all; must be last. | |
goto | string | “end” to terminate, “next” to advance, or “$task-id” to jump to a task. | |
panic | Fault | Terminate as ‘failed’ with this code and message — a defect. Nothing can catch a panic. | |
raise | Fault | Terminate as ‘raised’ with this code and message — a condition a parent can catch. |
Shape
The value of an output, a body, or any other templated slot.
-
string— A $: typed expression, a ${ } interpolation template, or a literal string. -
number -
boolean -
null -
any[]— Literal array; each element is recursively a Shape. -
object— Literal object; each value is recursively a Shape.