Purpose
The Condition node allows you to create branches in your flow based on specific criteria. It acts like an "if-then-else" statement, directing users down different paths based on their responses or other variables.
Configuration
- Add Conditions: Click "Add Condition" to create a new rule. Each rule will create a new output handle (a dot) on the right side of the node.
- Select a Variable: Choose a variable from your flow (e.g.,
{{age}}
or{{user_choice}}
). - Choose a Match Type: Select how you want to evaluate the variable:
- Equals: The variable must exactly match the value.
- Does not equal: The variable must be different from the value.
- Contains: The variable must contain the specified text (case-insensitive).
- Greater than / Less than: For numerical comparisons.
- Set the Value: Enter the value to compare against (e.g., "Yes" or "18").
Branching
- Connect each output handle to the next node for that specific path.
- The "Fallback" handle is used if none of the conditions are met. Always connect the Fallback path to ensure your flow doesn't stop unexpectedly.
Example
You ask a user "Do you agree to the terms? (Yes/No)" and store the answer in {{terms_agreed}}
. A condition node can check if {{terms_agreed}}
equals "Yes". If it does, you proceed with the flow. If not, the Fallback path can send a message saying "You must agree to the terms to continue."