Skip to main content

Using Conditions & Branches

Make your workflows smarter with conditional logic. Route executions based on data, create multiple paths, and handle different scenarios automatically.

Time to complete: 15-20 minutes


Why Use Conditions?

Without conditions, workflows are linear. With conditions, they become intelligent:

Without ConditionsWith Conditions
Same action for everyoneDifferent paths based on data
No error handlingGraceful error paths
Fixed behaviorDynamic responses
One-size-fits-allPersonalized automation

Logic Nodes Overview

NodePurposeOutputs
ConditionSimple true/false branching2 paths
Multi-ConditionComplex boolean logicMultiple paths
Workflow SwitchJump to different workflowNew workflow
LoopIterate over arraysSingle path, multiple runs
MergeCombine branchesSingle output
DelayPause or split executionNormal + timeout paths

Condition Node

The simplest way to branch your workflow.

How It Works

  1. Evaluates a single condition
  2. Routes to True path if condition passes
  3. Routes to False path if condition fails

Configuration

FieldDescriptionExample
VariableData to evaluate{{contact.lead_score}}
OperatorComparison typegreater_than
ValueCompare against80

Available Operators

Text Operators:

OperatorDescriptionExample
equalsExact matchname equals "John"
not_equalsNot equalstatus not_equals "closed"
containsHas substringemail contains "@company.com"
not_containsMissing substringnotes not_contains "spam"
starts_withBegins withphone starts_with "+1"
ends_withEnds withemail ends_with ".edu"
is_emptyNo valuenotes is_empty
is_not_emptyHas valueemail is_not_empty

Numeric Operators:

OperatorDescriptionExample
equalsEqual toscore equals 100
greater_thanGreater thanscore greater_than 80
less_thanLess thanage less_than 18
greater_than_or_equal>=amount >= 1000
less_than_or_equal<=days_idle <= 30

List Operators:

OperatorDescriptionExample
inValue in liststage in "lead,prospect,customer"
not_inValue not in liststatus not_in "spam,invalid"

Pattern Matching:

OperatorDescriptionExample
regex_matchRegular expressionphone regex_match ^\+\d{10,}

Example: Lead Score Routing

Variable: {{contact.lead_score}}
Operator: greater_than
Value: 80

True → Assign to Sales
False → Add to Nurture Campaign

Output Variables

{{condition_1.condition_result}} - true/false
{{condition_1.left_value}} - The evaluated value
{{condition_1.right_value}} - The comparison value
{{condition_1.operator}} - Operator used

Multi-Condition Node

For complex logic with multiple conditions and paths.

How It Works

  1. Define condition groups (sets of conditions)
  2. Create output paths using boolean expressions
  3. Route based on which paths match
  4. Default path catches unmatched cases

Configuration Structure

Condition Groups:

Group 1: "High Value"
├── lead_score > 80 AND
└── company_size = "Enterprise"

Group 2: "Engaged"
├── email_opened = true OR
└── page_views > 5

Output Paths:

Path 1: "Priority Lead" (if group1 AND group2)
Path 2: "Standard Lead" (if group1 OR group2)
Default: "New Lead"

Boolean Expressions

Combine groups with logical operators:

ExpressionMeaning
group1Group 1 matches
group1 AND group2Both match
group1 OR group2Either matches
NOT group1Group 1 doesn't match
(group1 AND group2) OR group3Complex logic

Execution Modes

ModeBehavior
first_matchExecute first matching path only (default)
all_matchesExecute ALL matching paths
error_on_allReturn error if no paths match

Example: Customer Segmentation

Condition Groups:

Group 1: "Enterprise"

  • company_size equals "Enterprise"
  • annual_revenue greater_than 1000000

Group 2: "Engaged"

  • email_opened_last_30d equals true
  • page_views greater_than 10

Group 3: "At Risk"

  • days_since_login greater_than 60

Output Paths:

PathExpressionAction
VIP Customergroup1 AND group2Dedicated support
Enterprise Riskgroup1 AND group3Urgent outreach
Engaged SMBgroup2 AND NOT group1Upgrade campaign
At Riskgroup3Re-engagement flow
Default-Standard nurture

Output Variables

{{multicondition_1.success}} - Execution successful
{{multicondition_1.path_id}} - Selected path ID
{{multicondition_1.path_name}} - Selected path name
{{multicondition_1.matching_paths}} - All matching paths

Workflow Switch Node

Jump to a completely different workflow.

When to Use

  • Intent routing: Route to specialized workflows
  • Escalation: Hand off to different process
  • Complex subflows: Call reusable workflows

Switch Modes

ModeUse Case
intent_basedRoute by detected intent
condition_basedRoute by conditions
explicitAlways go to specific workflow

Intent-Based Switching

Map intents to workflows:

Intent Mappings:
├── "support" → Support Ticket Workflow
├── "billing" → Billing Inquiry Workflow
├── "sales" → Sales Conversation Workflow
└── Default → General FAQ Workflow

Condition-Based Switching

Route based on data:

Conditions:
├── customer_type equals "enterprise" → Enterprise Workflow
├── issue_type equals "urgent" → Urgent Response Workflow
└── Default → Standard Workflow

Context Preservation

OptionPurpose
pass_contextShare data with target workflow
save_contextSave current state for return
pause_currentPause for later resumption

Loop Node

Iterate over arrays to process multiple items.

How It Works

  1. Receives an array
  2. Executes downstream nodes for each item
  3. Collects results from all iterations

Configuration

FieldDescriptionExample
array_sourcePath to array{{api_response.items}}
concurrentProcess in paralleltrue
max_concurrentMax parallel items5
continue_on_errorSkip failed itemstrue

Iteration Variables

Inside the loop, these variables are available:

{{loop_1.current_item}} - Current array item
{{loop_1.current_index}} - Zero-based index
{{loop_1.total_items}} - Total items count

Example: Process Order Items

Loop over: {{order.items}}
Concurrent: true
Max concurrent: 10

For each item:
→ Check inventory
→ Update stock
→ Generate label

Output Variables

{{loop_1.results}} - Array of all results
{{loop_1.iterations}} - Total iterations
{{loop_1.successful}} - Successful count
{{loop_1.errors}} - Array of errors

Merge Node

Combine multiple branches back into one.

Why Use Merge

After a condition splits your workflow, you may want to:

  • Continue with a single path
  • Combine data from different branches
  • Ensure one output regardless of path taken

Merge Strategies

StrategyBehavior
first_non_nullReturn first input that has data
merge_objectsDeep merge all objects
concatenate_arraysJoin all arrays together

Example: First Non-Null

Input 1: null
Input 2: { name: "John" }
Input 3: { name: "Jane" }

Result: { name: "John" } // First non-null

Example: Merge Objects

Input 1: { email: "john@example.com" }
Input 2: { phone: "+1234567890" }
Input 3: null

Result: {
email: "john@example.com",
phone: "+1234567890"
}

Configuration

Strategy: merge_objects
Inputs: Connect from multiple branches

Output Variables

{{merge_1.output}} - Merged result
{{merge_1.merged_from.input1}} - Was input1 included?
{{merge_1.merged_from.input2}} - Was input2 included?

Delay Node

Pause execution or create time-based splits.

Delay Types

TypeUse Case
timeWait fixed duration
until_calendar_dateWait until specific date
until_date_propertyWait until entity's date field
until_day_of_weekWait until specific day
until_time_of_dayWait until specific time
conditionWait for email activity
whatsapp_conditionWait for WhatsApp activity
website_conditionWait for website activity
percentage_splitA/B test routing

Time Delay

Wait for a fixed duration:

Delay Duration: 30
Delay Unit: minutes

Available Units:

  • seconds
  • minutes
  • hours
  • days
  • weeks
  • months

Wait for Activity

Wait until specific engagement occurs:

Email Activity:

Delay Type: condition
Activity Type: opened
Email Message ID: {{email_send_1.message_id}}
Timeout: 3 days

Website Activity:

Delay Type: website_condition
Activity Type: page_view
URL Pattern: /pricing
Contact ID: {{contact.id}}
Timeout: 7 days

Percentage Split (A/B Testing)

Split traffic for testing:

Branches:
├── Variant A: 50%
└── Variant B: 50%

Seed Field: {{contact.email}} // For deterministic split

Output Paths

PathWhen
outputNormal completion
timeoutCondition not met in time

Common Patterns

Pattern 1: Error Handling

API Request Node


Condition: status_code equals 200

├── True → Process Response

└── False → Error Handler
├── Log Error
└── Send Alert

Pattern 2: Lead Qualification

New Lead Trigger


Multi-Condition Node

├── "Hot Lead" (score > 80 AND company_size = Enterprise)
│ └── Assign to Sales + Slack Alert

├── "Warm Lead" (score > 50)
│ └── Add to Nurture Sequence

└── "Cold Lead" (default)
└── Add to Long-term Drip

Pattern 3: Bulk Processing with Loop

Get All Pending Orders


Loop: {{orders}}

▼ (for each order)

├── Check Inventory
├── Process Payment
├── Send Confirmation


Merge Results


Send Summary Report

Pattern 4: Follow-up Sequence

Send Email


Delay: Wait 3 days


Condition: email_opened

├── True → Send Follow-up B

└── False → Send Follow-up A (resend)


Delay: Wait 5 days


Condition: still no open

└── Mark as Unresponsive

Pattern 5: A/B Testing

New Signup Trigger


Delay: Percentage Split (50/50)

├── Variant A → Welcome Email V1

└── Variant B → Welcome Email V2


Track Results (both paths)

Best Practices

Condition Design

✅ Use specific operators (equals vs contains)
✅ Handle null/empty cases explicitly
✅ Keep conditions simple and readable
✅ Document complex logic with node aliases

❌ Don't nest too many conditions
❌ Don't forget default/else paths
❌ Don't compare incompatible types

Branch Management

✅ Name your paths clearly
✅ Use merge nodes to recombine
✅ Keep parallel branches balanced
✅ Test all possible paths

❌ Don't create orphaned branches
❌ Don't let branches diverge indefinitely
❌ Don't forget error handling paths

Performance

✅ Evaluate fastest conditions first
✅ Use concurrent loops when possible
✅ Set reasonable timeouts
✅ Limit loop iterations

❌ Don't loop over very large arrays
❌ Don't create infinite loops
❌ Don't forget timeout paths

Troubleshooting

Condition Always False

  1. Check variable path - Is it spelled correctly?
  2. Verify data exists - Does field have value?
  3. Check types - Comparing string to number?
  4. Test values - Print actual vs expected

Wrong Path Taken

  1. Review operator - equals vs contains?
  2. Check case sensitivity - "John" vs "john"
  3. Verify logic - AND vs OR?
  4. Test with debug mode - See actual evaluation

Loop Not Executing

  1. Check array source - Does it return array?
  2. Verify array length - Is it empty?
  3. Test variable path - Correct nesting?
  4. Check permissions - Can access data?

Merge Not Working

  1. Check connections - All inputs connected?
  2. Verify strategy - Right merge type?
  3. Test input data - What's actually arriving?
  4. Review timing - All branches complete?

Next Steps

With conditional logic mastered, continue with:

  1. AI Nodes & Prompts - Add AI intelligence
  2. Testing Workflows - Debug effectively
  3. Error Handling - Build resilient workflows

Quick Reference

Operators

CategoryOperators
Equalityequals, not_equals
Comparisongreater_than, less_than, >=, <=
Textcontains, starts_with, ends_with
Presenceis_empty, is_not_empty
Listin, not_in

Boolean Logic

AND - Both conditions must be true
OR - Either condition can be true
NOT - Inverts the condition
() - Groups for precedence

Node Outputs

NodeKey Output
Conditioncondition_result (true/false)
Multi-Conditionpath_id, path_name
Loopcurrent_item, current_index
Mergeoutput
DelayPath: output or timeout