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:

ModeBehaviorExample
ANDAll conditions must be trueLanguage is English AND state is Texas
ORAny condition can be trueStatus is "VIP" OR spend is greater than 10000

Operators

Each condition uses one of 10 operators to compare a variable against a value:

OperatorDescriptionExample
equalsExact match (case-sensitive){{language}} equals English
not_equalsDoes not match{{status}} not_equals blocked
containsVariable contains the substring{{interests}} contains dental
not_containsVariable does not contain the substring{{email}} not_contains spam
not_emptyVariable has a value (not empty/null){{phone_number}} not_empty
is_emptyVariable is empty, null, or unset{{email}} is_empty
greater_thanNumeric comparison: variable > value{{age}} greater_than 18
less_thanNumeric comparison: variable < value{{budget}} less_than 500
starts_withVariable begins with the string{{phone}} starts_with +1512
ends_withVariable 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

HandlePositionColorPurpose
InputTopBlueReceives connections
BranchRight (one per branch)GreenPath when branch conditions match
DefaultRight/BottomStandardFallback when no branch matches

Real-World Examples

Lead Qualification

After extracting budget and company_size:

  • Branch 1 (AND): budget greater_than 5000 AND company_size greater_than 10 → Route to "Qualified Lead" conversation
  • Branch 2: budget greater_than 1000 → Route to "Warm Lead" conversation
  • Default: Route to "Nurture" conversation

Language Routing

After extracting preferred_language:

  • Branch 1: preferred_language equals Spanish → Route to Spanish-speaking agent flow
  • Branch 2: preferred_language equals French → Route to French flow
  • Default: Continue in English

Data Completeness Check

Before submitting to a CRM, verify required fields are collected:

  • Branch 1 (AND): name not_empty AND email not_empty AND phone not_empty → Proceed to API call
  • Default: Loop back to conversation node to ask for missing info

Was this article helpful?