Control Flow
Conditional Logic & Branching Documentation
Direct the flow of your workflow based on dynamic data conditions using If-Else and Switch nodes.
Quick Answer: What are Conditional Logic Nodes?
[!NOTE] Conditional Logic Nodes (If-Else and Switch) act as the central decision-makers of your workflow. They evaluate data from previous nodes and choose which path the automation should take next. For example: "If the file is a PDF, send it to the Compressor; if it is a Word document, send it to the Converter."
Core Capabilities
1. File Type Routing
Automatically handle different file types in a single entry point. Use an If-Else node to check {{trigger.file.type}}. True branch goes to PDF Tools, False branch goes to Image Tools.
2. Threshold-Based Decisions
Connect an AI Extract Node to an If-Else node. Route invoices over $5,000 to an "Approval" sub-workflow, while auto-processing small amounts.
3. Sophisticated Dispatching
Use the Switch Node for tiered automated systems. Route documents based on a priority field: high goes to a Priority Printer, medium goes to Email, and low goes to Cloud Storage.
Configuration Guide
| Node | Setting | Description |
|---|---|---|
| If-Else | Condition List | A set of rules (e.g., amount > 100). |
| If-Else | Logical Operator | Choose AND (all rules must pass) or OR (one rule must pass). |
| Switch | Reference Field | The variable to watch (e.g., {{node.status}}). |
| Switch | Case Mapping | Map values (e.g., completed) to specific output handles. |
Best Practices
- Default Case: In a Switch node, always provide a "Default" output to catch unexpected values and avoid workflow stalls.
- Variable Presence: Use the
existsoperator to check if an AI Agent successfully returned a field before performing math operations on it.
[!TIP] Repeating logic across multiple items? Combine these nodes with a Loop Node to apply conditional filtering to every file in a batch.