Skip to main content

Condition Routing

Evaluate conditions and direct workflow execution based on true or false outcomes.

What is Condition Routing?

The Condition Routing node provides dynamic flow control by evaluating conditions against input data and routing the workflow based on whether the condition is true or false. It enables you to create branching logic in your workflows, allowing different execution paths based on the data being processed.

How to use it?

To implement conditional logic in your workflows:

  1. Select Condition Type:

    • Text Value Matcher: Compare text/string values
    • Number Value Matcher: Compare numerical values
    • File Type Matcher: Check file types and extensions
  2. Configure Matching Logic:

    For Text Values:

    • Equals: Exact match comparison
    • Includes: Check if text contains a substring
    • Begins with: Check if text starts with specific value
    • Ends with: Check if text ends with specific value
    • Matches Regular Expression: Use regex patterns for complex matching
    • Negative options: Does not equal, does not include, etc.

    For Number Values:

    • Mathematical comparisons: Equals, greater than, less than, etc.
    • Number properties: Is even, is odd, is positive, is negative
    • Divisibility: Multiple of, divisible by, is prime
    • Number types: Is whole number, is decimal
  3. Define Expected Value:

    • Set the value to compare against your input data
    • This can be static text, numbers, or file types
    • Use dynamic values from other nodes in your workflow
  4. Set Passthrough Value Type:

    • Text: Pass string data through the routing
    • Number: Pass numerical data through the routing
    • JSON: Pass structured object data through the routing
    • File: Pass file data through the routing
  5. Connect Output Branches:

    • True: Connects when condition is met
    • False: Connects when condition is not met (optional)
    • Continue your workflow with different logic for each branch

Example of usage

Objective: Route customer support tickets based on priority level and direct them to appropriate processing workflows.

Condition Routing Setup:

  1. Priority Level Routing:

    • Condition Type: Text Value Matcher
    • Matching Type: Equals
    • Expected Value: "High"
    • Comparison Input: Connected to ticket priority field
    • Passthrough Value: JSON (to pass full ticket data)
  2. True Branch (High Priority):

    • Route to urgent processing workflow
    • Send immediate notifications
    • Assign to senior support team
  3. False Branch (Normal Priority):

    • Route to standard processing workflow
    • Add to regular queue
    • Follow standard response timeline

Additional Examples:

File Processing by Type:

  • Condition Type: File Type Matcher
  • Expected Value: "pdf"
  • True: Route to PDF text extraction workflow
  • False: Route to alternative file processing

Numerical Data Filtering:

  • Condition Type: Number Value Matcher
  • Matching Type: Greater Than
  • Expected Value: 100
  • True: Process large dataset workflow
  • False: Process small dataset workflow

Additional information

Workflow Patterns

Simple Branching:

  • Single condition with two possible outcomes
  • Direct routing based on straightforward criteria
  • Minimal complexity for basic decision making

Multi-Level Conditions:

  • Chain multiple Condition Routing nodes for complex logic
  • Create decision trees with multiple branching points
  • Implement sophisticated business logic flows

Data Validation:

  • Use conditions to validate data quality before processing
  • Route invalid data to error handling or cleaning workflows
  • Ensure data meets requirements before expensive operations

Integration Strategies

Input Data Sources:

  • Connect to any node output that provides the data type you're evaluating
  • Use with File Reader outputs for file-based routing
  • Combine with API responses for dynamic decision making
  • Integrate with user inputs for interactive workflows

Output Routing:

  • True Branch: Continue with primary workflow when conditions are met
  • False Branch: Handle alternative scenarios or error cases
  • Both Branches: Use for parallel processing with different logic paths

Best Practices

Condition Design:

  • Make conditions as specific as possible to avoid unexpected routing
  • Test edge cases and boundary conditions thoroughly
  • Document your condition logic for workflow maintainability
  • Use descriptive expected values that clearly indicate intent

Performance Optimization:

  • Place most common conditions first in multi-level routing
  • Use efficient matching types (equals is faster than regex)
  • Minimize complex regular expressions for better performance
  • Consider data preprocessing to simplify condition logic

Workflow Organization:

  • Keep routing logic close to the data sources being evaluated
  • Document expected data formats and validation rules
  • Plan for both positive and negative condition outcomes

Common Use Cases:

Data Processing:

  • Route different data formats to specialized processing workflows
  • Filter data based on quality or completeness criteria
  • Direct large vs. small datasets to appropriate handling systems

Content Management:

  • Route content based on type, size, or metadata
  • Implement approval workflows based on content criteria
  • Direct content to different publication or storage systems

User Experience:

  • Personalize workflows based on user preferences or roles
  • Route requests based on user authorization levels
  • Implement feature flags and conditional functionality

Quality Assurance:

  • Validate data before expensive processing operations
  • Route failed validations to error handling or manual review
  • Implement multi-stage approval processes with conditional logic

The Condition Routing node provides essential decision-making capabilities that enable dynamic, intelligent workflows that adapt based on the data they process.