Seems like the current agents are all auto dispatc...
# ask-ai
g
Seems like the current agents are all auto dispatched. If we have four workers, can we assign which worker the agent is dispatched to?
t
Thanks for reaching out, Rio. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I’m responding to your question about whether you can assign which worker an agent is dispatched to when you have multiple workers. Short answer: yes. Auto-dispatch is the default, but you can disable it for an agent and explicitly dispatch that agent to a specific worker. How to do that: • Give each worker a unique
agent_name
. When an agent has an
agent_name
, automatic dispatch is disabled for that agent and it will only join rooms when explicitly dispatched. • Use explicit dispatch to target that named agent: ◦ Call the agent dispatch API (for example,
CreateAgentDispatchRequest
) with the
agent_name
and the target room. ◦ Or include
RoomAgentDispatch
in the access token’s
RoomConfiguration
so the token dispatches the named agent when a participant connects. ◦ For SIP flows, set
agentName
in
roomConfig.agents
to route inbound calls to a specific named agent. Note on load balancing: • If multiple workers share the same
agent_name
, LiveKit will load balance across them. To target a specific individual worker, ensure that worker has a unique
agent_name
and dispatch to that name. If you’d like, tell me: • How many workers you have and whether they currently share the same
agent_name
, and • Whether you prefer dispatch via API, token configuration, or SIP rules— and I’ll give step-by-step instructions for the method you want to use. Sources: Why do jobs stop after agent rejection? | LiveKit | Agent dispatch | LiveKit Documentation | Agents telephony integration | LiveKit Documentation