This document explains the Router node, which enables smart conditional routing in your workflows by directing data through different paths based on AI decisions or logical conditions.

What Does the Router Node Do?

The Router node acts as a decision point in your workflow, allowing you to split your flow into multiple paths and automatically choose which path to follow based on your configuration. Think of it like an if-else statement, but much more powerful - instead of just two paths (if/else), you can create up to 8 different routes and use AI to make intelligent routing decisions.

Real-World Example: If you’re building a flow that processes incoming support tickets, you might want to:

  • Route urgent tickets to your escalation team
  • Send billing questions to your finance department
  • Direct general inquiries to your standard support queue

The Router node evaluates each ticket and automatically sends it down the appropriate path based on the conditions you define.

Real-World Workflow Examples

Understanding the Router node is easier with concrete examples. Here are two workflows that demonstrate the key differences between AI and standard routing:

Lead Website Analyzer (Standard Routing)

View Workflow →

This workflow uses logical conditions to qualify leads by detecting website technology.

How it works:

  1. Sheet Reader → Reads prospect websites from Google Sheet
  2. Website Scraper → Scrapes each website to get content
  3. Router (Standard Mode) → Uses text conditions to detect platforms
  4. Actions → Routes qualified leads to Slack, others to Gmail rejection

Router Configuration:

Route 1: "Shopify Leads" (Qualified)
Conditions:
- website_content [Text] Contains "shopify"
- OR website_content [Text] Contains "myshopify.com"

Route 2: "Other Websites" (Rejected)  
Conditions: - website_content [Text] Does not Contain "shopify"

Why Standard Routing: This is deterministic - if the scraped content contains specific Shopify keywords, it’s definitely a Shopify store. No interpretation needed, just exact keyword matching.

Support Request Triage (AI Routing)

View Workflow →

This workflow uses AI-powered routing to intelligently categorize support requests.

How it works:

  1. Gmail Reader → Reads support emails from a specific label
  2. Router (AI Mode) → Uses AI to understand intent and urgency
  3. Actions → Routes to appropriate teams and systems

Router Configuration:

Route 1: "General Questions"
AI Condition: "standard support questions and general inquiries"
Action: Slack notification to general support

Route 2: "Billing Questions"  
AI Condition: "questions about payments, invoices, or account billing"
Action: Email finance team

Route 3: "Feature Request"
AI Condition: "Feature request or general improvement requested by the user"
Action: Create Linear ticket 

Why AI Routing: This requires interpretation - the AI needs to understand context, tone, and intent to determine urgency and category. Keywords alone aren’t enough hence logical/standard routing method won’t be the best option.

Key Differences

AspectLead Analyzer (Standard Routing)Support Triage (AI Routing)
Decision LogicKeyword detectionContent interpretation
Routing BasisExact text matchesContext and intent
Consistency100% deterministicIntelligent but may vary
Use CaseClear yes/no criteriaNuanced categorization

Common Elements

Both workflows demonstrate important Router concepts:

  • Loop Mode: Processing multiple items individually
  • Fallback Routes: Catching unmatched items
  • Multiple Actions: Different routes trigger different responses

These examples show when to choose each routing mode based on your specific needs.

Node Inputs

Input to Evaluate

The specific data that the Router uses to make routing decisions. This is the field that gets analyzed to determine which route to take.

Example: If you’re processing support tickets, you might choose:

  • ticket_description - to route based on the content of the issue

Routes

The different paths your data can follow (maximum 8 routes). Each route represents a different outcome or processing path.

Example: For a support ticket system:

  • Route 1: “Urgent”
  • Route 2: “Billing Question”
  • Route 3: “Technical Support”
  • Route 4: “General Inquiry”

Optional Fields

Route With AI

Toggle between AI-powered routing and standard logical routing. This is enabled by default - you’ll need to turn it off if you want to use standard logical routing instead.

Example:

  • AI Mode (Default): Let AI decide if an email is a “complaint” vs “compliment” based on content
  • Standard Mode: Use logical conditions like “if priority equals ‘high’ then route to urgent”

AI Model Selection

Choose which AI model to use for routing decisions (only available when AI mode is enabled).

Node Outputs

The Router node creates branches - separate output paths for each route you define. Each branch contains all the inputs that were passed into the Router node, not just the input you’re evaluating.

How Outputs Work

Key Point: Every route gets access to all the input data, but only one route will be active per item.

Example Setup:

  • Inputs to Router: ticket_description, ticket_title, ticket_link, customer_email
  • Input to Evaluate: ticket_description (this determines the routing)
  • Routes: “Urgent”, “Billing Question”, “Technical Support”

Resulting Outputs: Each route creates a separate branch with all the input data.

Visual Representation

Router Node
├── Input: ticket_description (used for routing decision)
├── Input: ticket_title
├── Input: ticket_link
└── Input: customer_email

Routes:
├── Urgent Branch → [ticket_description, ticket_title, ticket_link, customer_email]
├── Billing Question Branch → [ticket_description, ticket_title, ticket_link, customer_email]
└── Technical Support Branch → [ticket_description, ticket_title, ticket_link, customer_email]

Connecting Outputs

After the Router, you can connect each branch to different nodes:

Router
├── Urgent Branch → Slack Alert (immediate notification)
├── Billing Question Branch → Gmail Sender to Finance Team
└── Technical Support Branch → Jira Issue Writer

Each downstream node receives all the input data for the items that were routed to that branch.

Important Notes

  1. All Data Available: Every route has access to all input data, not just the evaluation input
  2. Selective Activation: Only one route per item will be active and pass data through
  3. Preserve Context: All related information stays together through the routing process

Routing Modes

AI routing uses natural language to make intelligent routing decisions based on context and content understanding.

How It Works

  1. Input Selection: Choose which input data the AI should evaluate
  2. Route Definition: Create routes with descriptive names
  3. AI Conditions: Describe when each route should be used (optional but recommended)
  4. Model Selection: Choose an AI model for decision-making

Configuration Example

Route Name: "Customer Complaint"
Input to Evaluate: email_content
AI Condition: "when the email expresses dissatisfaction, frustration, or requests a refund"

Route Name: "Product Inquiry"  
Input to Evaluate: email_content
AI Condition: "when the email asks questions about features, pricing, or product information"

Route Name: "Technical Support"
Input to Evaluate: email_content  
AI Condition: "when the email reports bugs, technical issues, or requests help with setup"

Best Practices for AI Routing

  1. Use Descriptive Route Names: Even without AI conditions, the AI can often infer routing logic from clear route names

    ✅ Good: "Positive Review", "Negative Review", "Neutral Review"
    ❌ Poor: "Route A", "Route B", "Route C"
    
  2. Provide Clear AI Conditions: Give the AI enough information to make accurate decisions

    ✅ Good: "when the message expresses anger, frustration, or demands immediate action"
    ❌ Poor: "negative sentiment"
    
  1. Choose the Right AI Model: Use more powerful models for complex routing decisions

Standard Routing Mode

Standard routing uses logical conditions and boolean operators for precise, rule-based routing. This mode is best when you have clear, measurable criteria for routing decisions.

How It Works

  1. Route Definition: Create named routes for different paths
  2. Condition Building: Set up logical conditions using the condition dropdown
  3. Boolean Logic: Combine conditions with AND/OR operators within each route
  4. Sequential Evaluation: Routes are evaluated in order from top to bottom - first match wins

Supported Condition Types

ConditionDescription
General Conditions
Is emptyField is empty or null
Is not emptyField has content
Text Conditions
[Text] EqualsExact text match (case-sensitive)
[Text] Does not equalText is not an exact match
[Text] ContainsText includes substring
[Text] Does not containText does not include substring
[Text] Starts withText begins with specific string
[Text] Does not start withText does not begin with string
[Text] Ends withText ends with specific string
[Text] Does not end withText does not end with string
[Text] Is inChecks if your entire text value appears anywhere inside the condition text
[Text] Is not inChecks if your entire text value does NOT appear anywhere inside the condition text
[Text] Is greater than [n] charactersText length exceeds specified number
[Text] Is less than [n] charactersText length is under specified number
[Text] Matches regexText matches regular expression pattern
[Text] Does not match regexText does not match regex pattern
Number Conditions
[Number] EqualsExact number match
[Number] Is not equal toNumber is not exact match
[Number] Is greater thanNumber is larger than value
[Number] Is less thanNumber is smaller than value
[Number] Is greater than or equal toNumber is greater than or equal to value
[Number] Is less than or equal toNumber is less than or equal to value

Understanding Route Evaluation Order

Routes are evaluated sequentially from top to bottom. The first route that matches will be selected.

Example: If you have routes for “High Priority” and “Medium Priority”, and an item matches both conditions, it will go to “High Priority” because it appears first in the list.

Key Point: Order your routes from most specific to most general, with a catch-all route at the bottom.

Loop Mode Processing

The Router automatically enables Loop Mode when it detects list inputs.

Loop Mode ON (Default for Lists)

How it works: Each item in the list is evaluated individually and routed separately.

Example: Loop Mode On Workflow

Input: ["urgent ticket", "billing question", "general inquiry"]

Processing:
- Item 1: "urgent ticket" → Routes to Support Team
- Item 2: "billing question" → Routes to Finance Team  
- Item 3: "general inquiry" → Routes to General Team

Output: Items distributed across different routes

Notes

Input Validation

The Router performs comprehensive validation:

  • Type Consistency: All inputs that you’re evaluating must be the same type (text or list)
  • List Size Matching: All list inputs must have identical lengths

Credit Management

  • Standard Routing: 0 credits (logic-based, no external APIs)
  • AI Routing: Credits are charged based on the AI model being used:
    • Standard models: 2 credits
    • Advanced models: 20 credits
    • Expert models: 30 credits

Router vs If-Else Logic

The Router node works like if-else statements in programming, but with significant enhancements:

Traditional If-ElseRouter Node
Paths2 paths (if/else)Up to 8 routes
Decision MakingBasic logical conditionsAI-powered + logical conditions
ComplexitySimple true/falseComplex multi-path routing
Batch ProcessingBasicOptimized for single inputs + lists
Visual ClarityGeneric true/falseClear route names

Troubleshooting

Common Issues

  1. “No route matched” Error

    • Solution: Add a fallback route that catches unmatched items
    • Prevention: Test with edge cases and unexpected values
  2. “Input type mismatch” Error

  3. “List size mismatch” Error

Debugging Tips

  1. Test with Simple Cases: Start with clear-cut examples
  2. Monitor Run Logs: Check which routes are being selected
  3. Use Descriptive Names: Makes debugging easier
  4. Validate Inputs: Ensure input data is clean and expected format

Best Practices Summary

General Guidelines

  1. Start Simple: Begin with 2-3 routes and add complexity as needed
  2. Test Thoroughly: Validate routing decisions with sample data
  3. Use Descriptive Names: Clear route names improve maintainability
  4. Always Include a Fallback Route: Add a route with no conditions to catch unmatched items
  5. Order Routes by Priority: Place most specific conditions first, general conditions last

AI Routing Specific

  1. Choose Appropriate Models: Match model complexity to routing difficulty
  2. Provide Context: Give AI enough information to make accurate decisions
  3. Use Examples: Include examples in AI conditions when possible
  4. Test Consistency: Verify AI makes consistent routing decisions

Standard Routing Specific

  1. Order by Specificity: Most specific conditions first
  2. Use Logical Grouping: Combine related conditions effectively
  3. Validate Data Types: Ensure inputs match expected formats

The Router node is a powerful workflow control component that enables intelligent, conditional routing of data through multiple paths. Whether you need simple logical routing or complex AI-powered decisions, the Router node provides the flexibility and power to create sophisticated automation workflows.

Need Help?

If you’re stuck or have questions about using the Router node, don’t hesitate to reach out: