Skip to main content
Conditionals enable your workflows to make decisions and take different paths based on data, creating dynamic, intelligent automation.

Conditional Nodes

Switch Node

The Switch Node enables multi-branch conditional routing with complex conditions. Key Features:
  • Multiple condition paths
  • Complex condition builder
  • Default fallback path
  • Priority-based evaluation (top to bottom)
Use Cases:
  • Multi-way decisions (if/elif/elif/else)
  • Routing based on categories
  • Complex business logic
  • State machines

Conditional Node

The Conditional Node provides simple if/else branching. Key Features:
  • Two paths: true and false
  • Single condition
  • Simpler than Switch for binary decisions
Use Cases:
  • Yes/no decisions
  • Binary states
  • Simple validation checks

Connecting branches in V2

To run a step only on a branch, connect that branch’s output handle to the step. When building through the API, set the edge’s source_handle to when_true, when_false, or the Switch branch ID. Validation rejects routing edges that omit this field. Use output explicitly for a data dependency without branch gating. Putting a branch-handle reference in a Combine Text template does not gate execution. Multiple handles connected directly from the same routing node combine with OR: the receiving step can run when any connected handle fires, provided its other sources are live. For example, connecting both Conditional handles directly to one step allows it to run for either outcome. An ordinary step skips when any distinct source is dead. If each mutually exclusive branch has its own processing step, connect those steps to Join Paths (MergePathsNode) before continuing. Join Paths skips only when all its sources are dead.

Building Conditions

Condition Builder

Both Switch and Conditional nodes use a visual condition builder: Components:
  1. Left Value: The data to evaluate
  2. Operator: Comparison type
  3. Right Value: Value to compare against

Operators

Text Operators:
  • equals: Exact match
  • not equals: Not an exact match
  • contains: Substring match
  • not contains: Doesn’t contain substring
  • starts with: Begins with text
  • ends with: Ends with text
  • matches regex: Regex pattern match
  • is empty: Empty string or null
  • is not empty: Has value
Number Operators:
  • equals: Equal to
  • not equals: Not equal to
  • greater than: >
  • less than: <
  • greater than or equal: >=
  • less than or equal: <=
Boolean Operators:
  • is true: Value is true
  • is false: Value is false
List Operators:
  • contains: List contains item
  • not contains: List doesn’t contain item
  • is empty: Empty list
  • is not empty: Has items
  • length equals: List length equals number
  • length greater than: List length > number
  • length less than: List length < number

Complex Conditions

Combine multiple conditions with AND/OR logic: AND Condition (all must be true):
OR Condition (at least one must be true):
Nested Conditions:

Switch Node Patterns

Basic Multi-Way Branching

Example: Customer Type Routing

Priority Evaluation

Conditions are evaluated top to bottom, first match wins:
Important: Order matters! A value of 15000 matches Case 1 and won’t reach Case 2.

Category-Based Routing

Example: Support Ticket Routing

State Machine Pattern

Example: Order Status Processing

Conditional Node Patterns

Simple Validation

Example: Email Validation

Threshold Checking

Example: Approval Workflow

Null/Empty Checking

Example: Optional Field Handling

Common Patterns

Pattern 1: Validation Chain

Multiple validation checks in sequence:

Pattern 2: Early Exit

Check for error conditions early and exit:

Pattern 3: Confidence-Based Routing

Route based on AI confidence scores:

Pattern 4: Feature Flags

Enable/disable features dynamically:

Pattern 5: A/B Testing

Route to different logic for testing:

Advanced Techniques

Chaining Conditionals

Combine multiple conditionals for complex logic:

Computed Conditions

Use data from previous nodes in conditions:

Dynamic Routing Table

Use data lookup for routing decisions:

Working with Lists

List-Based Conditions

Conditionals work with list data:

Filtering Lists

Use Filter List node for list-based conditionals:

Conditional List Processing

Apply different processing based on list characteristics:

Error Handling with Conditionals

Check for Errors

Retry Logic

Fallback Logic

Debugging Conditionals

Common Issues

Condition Never True:
  • Check data types (string “1” vs number 1)
  • Verify exact spelling and casing
  • Use log nodes to inspect actual values
Wrong Path Taken:
  • Check condition order in Switch node
  • Verify AND/OR logic
  • Test with known values
Null/Empty Handling:
  • Add explicit null checks
  • Use “is empty” / “is not empty” operators
  • Provide default values upstream

Testing Tips

Use Test Data:
  • Test with known values that should match each path
  • Verify all branches are reachable
Log Values:
  • Add Log Value nodes before conditionals
  • Inspect actual data types and values
  • Verify condition variables exist
Edge Cases:
  • Test with null/empty values
  • Test with extreme values (very large, very small)
  • Test with unexpected data types

Best Practices

Design

Keep Conditions Simple: Complex conditions are hard to debug Use Descriptive Names: Name conditional paths clearly Avoid Deep Nesting: More than 3 levels of nesting is hard to follow Prefer Switch Over Chained Conditionals: For 3+ branches, use Switch node Handle Default Cases: Always include default/fallback paths

Performance

Early Exit: Check expensive conditions last Compute Once: Store computed values, don’t recalculate in each condition Minimize Branching: Fewer branches = simpler workflows

Maintainability

Document Complex Logic: Add comments to workflows explaining business rules Use Subflows: Extract complex conditional logic into subflows Centralize Rules: Consider storing rules in databases/config for easy updates

Example Workflows

Example 1: Lead Scoring and Routing

Example 2: Invoice Approval Workflow

Example 3: Content Moderation

Next Steps

Loops

Iterate with loop control

Subflows

Modular workflow components

Error Handling

Graceful error recovery

List Handling

Automatic list iteration

Conditionals are essential for building intelligent, dynamic workflows that adapt to data and make decisions automatically.