Conditional Node
The Conditional node picks exactly one of its outgoing branches based on a runtime condition, activating that branch’s target and marking every other branch target as skipped.
When to use
Section titled “When to use”Use Conditional whenever the path through the workflow depends on runtime data — classification outputs, success/error signals, user choice, etc. For fixed forks where all branches should run in parallel, use straight-line edges instead.
Configuration
Section titled “Configuration”| Field | Description |
|---|---|
condition_type | How the condition is evaluated. jq evaluates a jq expression against input data and reads its string output as the chosen label. regex matches a pattern with a named label group. llm asks an LLM to classify the input into one of the branch labels. |
condition_expression | The expression or prompt, interpreted per condition_type. |
branches | Map from label to target node ID. The label returned by evaluation selects which target activates. |
default_branch (optional) | Fallback target when evaluation returns a label that is not in branches. |
Condition types
Section titled “Condition types”jq—.category,.status == "ok" | if . then "ok" else "err" end. The output is coerced to a string and used as the label.regex—status:\s*(?<label>\w+). The named capture grouplabelis used.llm— a classification prompt. The LLM is instructed to output exactly one of the branch labels.
Behavior
Section titled “Behavior”- When cascade reaches the Conditional, it is inserted as
completed, and the condition is evaluated against its input data. - The chosen label is looked up in
branchesto find the target node ID; if not found,default_branchis used. - All outgoing edges other than the chosen one have their targets inserted as
skipped(so downstream joins can see they settled). - The chosen target is activated via the normal registry path (so nested fan-outs/conditionals still get type-specific activation).
- The Conditional’s
output_datais updated with_chosen_branchand_target_nodefor auditability.
If neither branches nor default_branch resolves, a warning is logged and the graph stalls at this point — always configure a default_branch when the evaluation output isn’t fully predictable.
Validation rules
Section titled “Validation rules”condition_typeis required.- Either
branches(non-empty) ordefault_branchmust be set. - Every target referenced in
branchesmust be a real node. - For every label in
branches, an outgoing edge to the target must exist on the graph. - Outgoing edges whose
condition_labelis set must match one of thebrancheslabels. default_branch, if set, must reference an existing node.
Example
Section titled “Example”flowchart LR Classify["Skill: classify-ticket"] --> C{{"Conditional"}} C -->|bug| Bug["Skill: bug-triage"] C -->|feature| Feat["Skill: feature-intake"] C -->|other| Other["Skill: fallback"]With condition_type: llm and a prompt “classify as bug, feature, or other”, the LLM’s label picks the branch. Setting default_branch: other protects against unexpected LLM output.