Skip to content

Control-flow nodes: decision, router and state

Control-flow nodes decide what happens next, or reshape the pipeline’s state without calling an external service.

Evaluates a template condition (Jinja-style) against the pipeline’s state and picks one of several named routes, with a default fallback if nothing matches.

FieldWhat it does
ConditionA template that resolves to one of your route names — for example, branching on whether a state variable contains “approved”
RoutesThe node IDs the condition can resolve to; route names must exactly match a node ID, case-sensitively
Default outputWhere to go if the condition resolves to nothing recognized

Router is fast and deterministic — no model call — best when the branching logic is an explicit rule.

Uses an LLM to pick a route based on a natural-language description, instead of a template rule. Best for routing that depends on interpreting meaning rather than matching a fixed pattern.

FieldWhat it does
DescriptionPlain-language instructions telling the model how to choose between routes
Decision outputsThe node IDs the model can choose from
Default outputFallback route if the model can’t decide confidently

Decision nodes are slower than Router (they make a model call) and cannot connect directly to another Decision node — put a Router, LLM, or Toolkit node between two decisions if you need a second one in sequence.

Decision node configuration with routing description and outputs

Reshapes the pipeline’s state without calling a model or a tool: combine values, format text, do simple arithmetic, or clear out variables you no longer need.

FieldWhat it does
TemplateA Jinja-style template referencing input variables — for example, Hello, {{ user_name }}!
InputThe state variables the template is allowed to read
OutputWhere the rendered result is written
Variables to cleanOptional list of variables to reset afterward (strings to "", lists to [], numbers to 0)