We use cookies to enhance your experience and measure how the site performs. Choose "Essential Only" to disable analytics. Read our Privacy Policy.

    Odeus Docs

    Condition

    Route workflow execution down different paths based on conditions and logic.

    Condition

    Route workflow execution down different paths based on conditions and logic.

    Condition

    Overview

    The Condition node adds branching logic to your workflow. Based on data from previous nodes, route execution down different paths - like if-then-else statements in code, but visual and no-code.

    Best for: Approval workflows, priority routing, data validation, multi-path automations, and decision logic.

    How It Works

    1. Add multiple conditions (If, Else if, etc.)
    2. Each condition evaluates to true/false using Manual or Prompt AI mode
    3. By default, the first matching condition is executed
    4. Enable "Allow multiple conditions" to execute all matching paths
    5. Each condition gets its own output handle on the node

    Configuration

    Model Selection

    Choose the AI model used for Prompt AI mode conditions. This only applies when using Prompt AI mode—Manual mode doesn't use AI.

    Condition Modes

    Each individual condition can use one of two modes:

    Manual Mode Write expressions inside {{ }} brackets:

    {{ trigger.output.amount > 1000 }}
    {{ agent.output.sentiment === "negative" }}
    {{ trigger.output.email.includes("@company.com") }}
    

    Important: All manual expressions must be wrapped in {{}} brackets.

    Prompt AI Mode Give natural language instructions for the AI to evaluate:

    Determine if this customer message requires urgent attention based on:
    - Keywords like "urgent", "emergency", "asap"
    - Angry or frustrated tone
    - Mention of high-priority issues
    
    Context: {{trigger.output.message}}
    

    Allow Multiple Conditions

    Disabled (default): First match wins

    • Conditions evaluated in order (top to bottom)
    • Only the first matching condition executes
    • Other conditions are skipped
    • Most common use case

    Enabled: All matching conditions execute

    • All conditions are evaluated
    • Every condition that returns true executes
    • Useful for triggering multiple parallel actions

    Force Select Branch

    When using Prompt AI mode, enabling "Force Select Branch" ensures the AI always selects at least one branch, even if none of the conditions seem to match perfectly.

    Disabled (default): AI may not select any branch if no condition matches Enabled: AI is forced to select the most appropriate branch

    This is useful when you need guaranteed workflow continuation and want the AI to make a best-effort decision.

    Example Use Cases

    Priority Routing (Manual Mode)

    Condition 1: "If High Priority"
    Mode: Manual
    Expression: {{ agent.output.structured.priority === "high" }}
    
    Condition 2: "Else if Medium Priority"
    Mode: Manual
    Expression: {{ agent.output.structured.priority === "medium" }}
    
    Condition 3: "Else Low Priority"
    Mode: Manual
    Expression: {{ true }}
    

    Customer Segmentation (Prompt AI Mode)

    Condition 1: "If is already a customer"
    Mode: Prompt AI
    Instructions: Check if {{trigger.output.email}} exists in our customer database based on {{http_request.output.customers}}
    
    Condition 2: "Else if is not a customer yet"
    Mode: Prompt AI
    Instructions: Determine if this is a new prospect
    

    Amount Threshold (Manual Mode)

    Condition 1: "If Needs Approval"
    Mode: Manual
    Expression: {{ trigger.output.amount >= 5000 }}
    
    Condition 2: "Else Auto-Approve"
    Mode: Manual
    Expression: {{ trigger.output.amount < 5000 }}
    

    Choosing Between Modes

    Use Manual Mode When:

    • Logic is straightforward (checking values, comparing numbers)
    • You need predictable, consistent results
    • You want to minimize AI credit usage
    • Conditions are based on exact data matching

    Use Prompt AI Mode When:

    • Logic requires understanding context or nuance
    • Evaluating natural language content
    • Making subjective judgments
    • Combining multiple factors that need interpretation

    Example - When Manual is Better:

    {{ trigger.output.amount > 1000 }}  ✅ Simple, clear, no AI needed
    

    Manual Mode Operators

    When writing manual expressions, you can use:

    Comparison: ===, !==, >, <, >=, <=
    Logical: && (and), || (or), ! (not)
    String Methods: .includes(), .startsWith(), .endsWith()
    Existence: Check if value exists with {{ trigger.output.field }}

    Examples:

    {{ trigger.output.status === "approved" }}
    {{ agent.output.structured.score > 80 && agent.output.structured.verified === true }}
    {{ trigger.output.email.includes("@company.com") }}
    {{ trigger.output.tags.includes("urgent") }}
    

    Best Practices

    Always add a final condition with `{{ true }}` to catch cases that don't match other conditions.
    
    
    
    Conditions are evaluated top to bottom. Put most specific conditions first,
    general ones last.
    
    
    
    Name conditions clearly: "If High Priority" not "Condition 1". This makes
    workflows easier to understand.
    
    
    
    Use Manual for simple logic checks. Use Prompt AI for complex evaluations that need context analysis.
    

    Next Steps

    • Agent Node — Use AI for complex decisions

    • Code Node — Write custom code logic

    • HTTP Request — Make API calls based on conditions

    • Variable Usage — Learn how to use variables in conditions