Router Task in AI Agent Studio
Updated
The Router Task is automatically added to every newly created AI Agent. It processes the first user message and routes the conversation to the appropriate task. The Router Task provides visibility into routing decisions and allows you to customize routing logic while ensuring reliable message flow.
Key Features
- Added by default – A Router Task is automatically created when you create a new AI Agent.
- Required component – Every AI Agent must contain one Router Task. It cannot be deleted or disabled.
- Customizable routing logic – Configure routing behavior using prompts, Groovy scripts, or tool-based routing.
- Single Router Task per agent – Only one Router Task is supported for each AI Agent.
- Applies to new AI Agents only – Existing AI Agents are not updated automatically.
Steps to Access the Router Task
- Create an AI Agent. For more information, see Creating AI Agent Application.
- In the AI Agent window, click Build from the left pane.

- Select Tasks to view the available tasks.
- Find the Router Task, click the Options icon, and select Edit.
Configure the Router Task
Task Overview
Provide the following details:
- Name – Enter a name for the task.
- Description – Add a description for the task.

Task Details
Configure the following settings:
Configure Qualifying Steps
Define a workflow that runs on the first user message before the conversation is routed to the main task.
- Enable Qualifying Task – Turn on this option to execute the qualifying workflow before routing.
- Create Qualifying Task – Click Create Qualifying Task to open the Dialogue Tree Builder and create the qualifying workflow.
Prompt Editor
Configure prompts that define routing behavior, execution flow, response guidelines, and tool usage.
Supported configurations include:
- Custom Router Prompt – Define routing instructions for incoming messages.
- Groovy Script – Configure dynamic routing logic programmatically.
- Tool Selection – Route messages to specific tools or workflows.
Ensure that all configured values and logic resolve successfully for proper routing.
Create Prompt
Click + Create Prompt to add a prompt that guides task execution.
Tools
Select the tools that the AI Agent can use while executing the Router Task. The agent invokes these tools based on the instructions defined in the task prompt.
Additional Settings
Configure the following optional settings:
- PII Masking Template – Apply a task-specific PII masking configuration.
- Guardrails – Configure controls for user inputs and AI Agent responses.
- Safety Settings Override – Override the default application-level safety settings for this task.
Note: By default, the Router Task inherits application-level settings. Any configuration applied here overrides the corresponding application-level setting.
Configure LLM Provider and Model
Configure the model settings used by the Router Task:
- LLM Provider – Select the provider for the primary LLM model. This field is pre-populated with the AI Agent's default provider.
- Model – Select the model to use for task execution.
- Max Tokens – Specify the maximum number of tokens that can be generated in a response.
- Temperature – Control response variability. Lower values produce more consistent responses, while higher values increase variation.
- Frequency Penalty – Reduce repetition of words and phrases in generated responses.
- Presence Penalty – Reduce the likelihood of repeating topics that have already appeared in the conversation.
Save the Configuration
After completing the configuration, click Save.