guides
Condition Node

Condition Node

The Condition node allows your bot to make decisions and branch to different paths based on variables, user inputs, or other criteria.

Condition Node

Overview

Condition nodes evaluate expressions to determine which path to follow in your conversation flow. They enable:

  • Personalized conversation paths based on user responses
  • Different handling of various scenarios
  • Dynamic behavior that adapts to user context
  • Complex decision-making capabilities in your bot

Configuration Options

Setting Up Conditions

The Condition node provides a simple interface to create logical expressions:

Condition Setup

A basic condition consists of:

  1. A variable to evaluate (often from a previous Question node)
  2. A comparison operator (equals, contains, greater than, etc.)
  3. A value to compare against

Comparison Operators

You can choose from various comparison operators to evaluate your conditions:

Comparison Operators

Available operators include:

  • Equal to
  • Not equal to
  • Contains
  • Does not contain
  • Starts with
  • Does not start with
  • Greater than
  • Less than

Complex Conditions

For more sophisticated scenarios, you can create compound conditions:

Complex Conditions

Options include:

  • AND logic: Require multiple conditions to be true
  • OR logic: Proceed if any condition is true
  • Multiple conditions: Add multiple evaluation points in a single node

Common Use Cases

  • Response Routing: Send users down different paths based on their answers
  • Language Detection: Route to language-specific flows based on user preference
  • User Qualification: Direct users to appropriate services based on their needs
  • Context-Aware Responses: Change bot behavior based on time, date, or user history
  • Error Handling: Detect and manage unexpected responses or edge cases

Best Practices

  1. Start simple: Begin with basic conditions before building complex logic
  2. Name your conditions: Use the content field to give each condition a clear description
  3. Consider edge cases: Always include a default path for unexpected scenarios
  4. Test thoroughly: Verify that all conditions work as expected with different inputs
  5. Limit nesting depth: Avoid overly complex nested conditions that are hard to maintain
  6. Document your logic: Add notes to explain complex decision trees for future reference

Connecting to Other Nodes

After a Condition node, connect each output to the appropriate next step:

  • Connect each condition output to a different part of your flow
  • The default path should handle unexpected or fallback scenarios
  • You can connect multiple conditions to the same next node if they should be handled identically

Examples

Basic Example: Checking a User Response

If {{user_preference}} equals "pricing"
  → Connect to Pricing Information Message node
If {{user_preference}} equals "support" 
  → Connect to Support Options Message node
Default
  → Connect to General Information Message node

Advanced Example: Qualifying Leads

If {{budget}} greater than "5000" AND {{timeline}} equals "immediate"
  → Connect to High Priority Lead flow
If {{budget}} greater than "1000" OR {{interest_level}} equals "high"
  → Connect to Medium Priority Lead flow
Default
  → Connect to Newsletter Signup flow

Notes and Limitations

  • Variables used in conditions must exist at runtime (set by previous nodes)
  • Conditions are evaluated in the order they are listed
  • The first matching condition determines the path taken
  • String comparisons are case-sensitive by default
  • Numeric comparisons require variables that contain only numbers