Workflow steps

condition

type: "condition"

Two branches. It compares two values and the graph takes true or false — both of which must exist.

freeboth branches required9 operators
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

leftany

Usually a template.

operatorstringeq

One of the nine below.

rightany

What to compare against. Unused by exists and empty.

The operators

OperatorTrue when
eq · neqEqual, or not.
containsThe left contains the right.
gt · gte · lt · lteOrdered comparisons.
existsThe left is there at all.
emptyThe left is empty.

An unknown operator is refused when the workflow is saved.

Both branches are required

edges: [
  { from: "check", to: "urgent", branch: "true" },
  { from: "check", to: "normal", branch: "false" },
]
edges = [
    {"from": "check", "to": "urgent", "branch": "true"},
    {"from": "check", "to": "normal", "branch": "false"},
]
A missing branch is refused, not defaulted

A condition with only a true edge would end the run, without a word, whenever the answer was false. Requiring both means every path is one somebody wrote.

Output

{{steps.check.output.result}}     // true or false
{{steps.check.output.left}}
{{steps.check.output.operator}}
"{{steps.check.output.result}}"    # True or False
"{{steps.check.output.left}}"
"{{steps.check.output.operator}}"

Branch on a schema, not on prose

A model step with a schema gives a boolean. Testing whether free text contains a word breaks the first time the model writes « not urgent ».