Router Task in AI Agent Studio
Updated
All the newly created AI Agents in AI Agent Studio will automatically include a Router Task. The Router Task ensures that the first incoming user message is processed and routed to the appropriate task. It provides visibility into how routing decisions are made and allows users to customize the logic, while still enforcing architectural requirements for reliable message flow.
The Router Task is generated automatically at the time of AI Agent creation.
The task becomes visible if the associated DP is enabled; this is turned on by default for new builds.
Edit the Router Task
Follow these steps to edit the Router Task:
Create an AI Agent
Create a new AI Agent.
For detailed steps, refer to Creating a Sprinklr AI Agent Application.
Access Task Manager
On the AI Agent screen, click the Expand icon next to Build.
Under Tasks, click the View button to access the Task record manager.
Edit the Router Task
Locate the Router Task in the list on the record page.
Click the vertical ellipses (⋮) icon beside it and select Edit.
Configure Routing Logic
On the Task Overview screen, update the Router Prompt. You can configure routing using one of the following methods:Custom Router Prompt – Define custom routing logic for messages.
Groovy Script – Apply programmatic control to handle dynamic routing.
Tool Selection – Route messages directly to specific tools or workflows.
Note: All configurations must resolve correctly (for example, through hardcoded values or Groovy logic) to ensure successful message routing.
Save Changes
After editing, click Save to apply the configuration.