Condition tool
Evaluates a boolean condition and splits the flow into two branches: if the condition is true («true» branch) or false («false» branch). Equivalent to an if/else.
When to use it
When the flow must take different paths based on a variable's value: if the customer already has a session, if an amount exceeds a threshold, if the user chose a specific option.
Steps
- 1Create a tool → choose type «Condition».
- 2Define the boolean expression. Examples: {{user.balance}} > 0 | {{response}} == 'yes' | {{list.length}} > 0
- 3In the canvas, the condition node has two outputs: «true» and «false».
- 4Connect each output to the corresponding branch node.
Reference
- Comparison operators
- == · != · > · < · >= · <=
- Logical operators
- && (and) · || (or) · ! (not)
- String comparison
- Use == with the exact value or include .toLowerCase() for case-insensitive comparison.
- «true» branch
- Node that runs when the condition is true.
- «false» branch
- Node that runs when the condition is false. If not connected, the flow ends on that branch.
Common errors
- Flow always goes to «false» branch
- The expression never evaluates to true. Print the variable value with a transform node before it to debug.
- «Variable not defined»
- The variable used in the condition doesn't exist at that point in the flow. Check the name and node order.
Next step
Learn Tool Agent to add AI to your flow.