genroc

docs / Reference / Definition language

Task

A task, the routing that follows it, and the value it publishes.

Task

FieldTypeRequiredDescription
idstringyesTask identifier, unique within the definition.
switchSwitchyesRequired. Routing: a shorthand (“next”, “end”, “$task-id”) or an ordered list of cases.
actionActionDescribes the action to perform. Omit for switch-only (routing) tasks.
on_errorError rule[]Ordered error-routing rules evaluated when the call fails. First match wins.
only_oncebooleanAt-most-once execution: only errors that never reached the remote may retry. Defaults to false.
outputShapeTemplated value remapping this task’s output; it becomes outputs.taskID and self.output.
output_schemaJSON SchemaJSON 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:

FieldTypeRequiredDescription
casestringBoolean expression. Omit for a catch-all; must be last.
gotostring“end” to terminate, “next” to advance, or “$task-id” to jump to a task.
panicFaultTerminate as ‘failed’ with this code and message — a defect. Nothing can catch a panic.
raiseFaultTerminate 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.