Logic Node & Conditional Branching
Overview
The Logic node lets you route conversations based on variable values. It evaluates conditions against your flow's variables and sends the conversation down different paths — no LLM call required. Think of it as an if/else-if/else block for your flow.
How Branches Work
Each Logic node has one or more branches. A branch contains one or more conditions, and each condition checks a variable against a value using an operator.
Branches are evaluated in order, top to bottom. The first branch whose conditions are all satisfied wins — the conversation follows that branch's edge. If no branch matches, the default path is taken.
Branch Logic: AND vs OR
Each branch has a logic mode that determines how multiple conditions within that branch are combined:
| Mode | Behavior | Example |
|---|---|---|
| AND | All conditions must be true | Language is English AND state is Texas |
| OR | Any condition can be true | Status is "VIP" OR spend is greater than 10000 |
Operators
Each condition uses one of 10 operators to compare a variable against a value:
| Operator | Description | Example |
|---|---|---|
equals | Exact match (case-sensitive) | {{language}} equals English |
not_equals | Does not match | {{status}} not_equals blocked |
contains | Variable contains the substring | {{interests}} contains dental |
not_contains | Variable does not contain the substring | {{email}} not_contains spam |
not_empty | Variable has a value (not empty/null) | {{phone_number}} not_empty |
is_empty | Variable is empty, null, or unset | {{email}} is_empty |
greater_than | Numeric comparison: variable > value | {{age}} greater_than 18 |
less_than | Numeric comparison: variable < value | {{budget}} less_than 500 |
starts_with | Variable begins with the string | {{phone}} starts_with +1512 |
ends_with | Variable ends with the string | {{email}} ends_with @gmail.com |
Default Path
Every Logic node has a default output. If none of the branches match, the conversation follows the default edge. Always connect the default path — otherwise the flow will stall if no conditions match.
Warning: If you don't connect a default path and no branches match, the engine has nowhere to go. Always wire up the default output.
Edge Handles
| Handle | Position | Color | Purpose |
|---|---|---|---|
| Input | Top | Blue | Receives connections |
| Branch | Right (one per branch) | Green | Path when branch conditions match |
| Default | Right/Bottom | Standard | Fallback when no branch matches |
Real-World Examples
Lead Qualification
After extracting budget and company_size:
- Branch 1 (AND):
budgetgreater_than5000ANDcompany_sizegreater_than10→ Route to "Qualified Lead" conversation - Branch 2:
budgetgreater_than1000→ Route to "Warm Lead" conversation - Default: Route to "Nurture" conversation
Language Routing
After extracting preferred_language:
- Branch 1:
preferred_languageequalsSpanish→ Route to Spanish-speaking agent flow - Branch 2:
preferred_languageequalsFrench→ Route to French flow - Default: Continue in English
Data Completeness Check
Before submitting to a CRM, verify required fields are collected:
- Branch 1 (AND):
namenot_empty ANDemailnot_empty ANDphonenot_empty → Proceed to API call - Default: Loop back to conversation node to ask for missing info