Router
The Router block directs workflow execution to different branches based on one of two evaluation modes: AI evaluation or comparison operators.
Route workflow branches using AI or comparison logic
The Router block directs workflow execution to different branches based on one of two evaluation modes: AI evaluation or comparison operators. In AI mode, the block takes a context string as a prompt and evaluates a list of case statements, using an AI model to select the most accurate match. In comparison mode, the context field serves as the left operand, and each case defines a right operand along with an operator such as equals, not equals, greater than, less than, contains, or exists checks — the first matching case determines the branch taken.
The block requires at least two cases, each identified by a unique ID. Each case can direct execution to a specific step within the current workflow using a destination step ID, or jump to an entirely different workflow using a destination workflow ID. In AI mode, a model override can optionally be specified; otherwise the organization's default model is used. The block outputs a single field, selectedCase, which is the zero-based index of the winning case.
The Router block fits into workflows that need conditional branching — for example, triaging user input into different handling paths, applying different processing logic based on data values, or jumping to specialized sub-workflows depending on context. Because it supports both AI-driven and rule-based evaluation, it can be used in workflows ranging from structured data pipelines to open-ended conversational applications.
What you can build
Real-world workflows powered by the Router block.
Customer Support Triage
Route incoming support messages to different handling workflows based on AI evaluation of the issue category, such as billing, technical, or general inquiries.
Form Field Validation
Use comparison operators to check whether a submitted form value meets required conditions, branching to an error step or a success step accordingly.
Sentiment-Based Branching
Evaluate the sentiment of a user message in AI mode and route positive, neutral, or negative responses to different reply workflows.
Subscription Tier Routing
Compare a user's subscription tier value against defined cases to direct them to the appropriate feature set or workflow path.
Language Detection Handoff
Use AI mode to identify the language of user input and jump to a language-specific workflow for localized processing or responses.
Multi-Step Decision Tree
Chain multiple Router blocks together to build a decision tree that progressively narrows down outcomes based on sequential AI or comparison evaluations.
Ready to add Router to your workflow?
Get Started FreeCommon questions about Router
What are the required parameters for the Router block?
The block requires a logic object containing a context string and a cases array with at least two entries. Each case must have a unique id and a condition. In comparison mode, each case also requires an operator field. Optionally, each case can specify a destinationStepId or destinationWorkflowId to control where execution goes when that case wins.
What does the Router block return?
The block outputs a single field called selectedCase, which is the zero-based index of the winning case from the cases array.
What is the difference between AI mode and comparison mode?
In AI mode (the default), an AI model evaluates the context string against all case conditions and selects the most accurate match. In comparison mode, the context field is treated as a left operand and each case's condition is the right operand, with the operator field determining how they are compared. The first matching case in comparison mode wins.
Can the Router block send execution to a different workflow entirely?
Yes. Each case supports a destinationWorkflowId field, which causes execution to jump to another workflow's initial step when that case is selected. Alternatively, destinationStepId routes execution to a specific step within the current workflow.
What kinds of workflows commonly use the Router block?
The Router block is used in workflows that require conditional branching, such as support ticket triage, form validation pipelines, multi-language handling, subscription-based feature routing, and any workflow that needs to direct execution differently based on data values or AI-evaluated conditions.
Related capabilities
Start
Specifies how the workflow is invoked
User Input
Prompt the user for one or more pieces of data that will be saved as a variable. Can include text, multiple choice, images, or files.
Run Function
Execute a custom JavaScript or Python function
Chat
Start a chat session with an LLM.
End
End the workflow. Optionally return a structured output (for API) or send notifications.
Jump
Transition to another workflow, maintaining the same scope
Add Router to your workflow
Build powerful AI workflows with drag-and-drop blocks. No coding required.