Skip to main content

How it works

  • Gate it with exactly one of if, infer or decide. See Conditions and bodies.
  • then runs when the condition holds; else runs otherwise. Omit else to continue without running anything.
  • With a decision model, decide.options and cases turn it into an N-way choice.

Limits

  • A branch is one tool call or a list of steps. It can contain exit, agent, ask, filter and route, but not map or reduce.

Input

map<string, object | object[]>
One branch per decide.options key, used instead of then.
object
A question answered by a decision model (only when one is configured). Without options it is yes/no and runs then when its probability reaches min_confidence; with options the model picks one and the matching entry in cases runs.
object
string
string
number
0 to 1; default 0.5
string
A decision model role; defaults to decider
map<string, string>
Case name → what that case means; 2 to 255 entries. Each name needs a branch under cases.
string
required
any
The data to judge, usually a template like {{E2.text}}
object | object[]
object
enum<string>
required
Available options: eq, ne, gt, lt, gte, lte, empty, not_empty, contains
any
Comparison operand (omit for empty/not_empty)
any
required
Usually a template like {{E0.issues.length}}
string
A yes/no question about prior results; runs then on yes.
string
Model role for the infer verdict (any configured role, standard or custom); defaults to the judge role.
object | object[]

Result

Later steps read these as {{<step id>.<field>}}.
string
Which branch ran, then or else, or the case name with cases.
string
Why the gate decided as it did, for infer and decide gates.
object
The output of the branch that ran.
boolean
Whether the condition held.