https://retellai.com/?utm_source=discord&utm_medium=seo logo
how to attach multiple single prompt agents to a s...
# ❓・ai-evy-support
j
@AI Evy how to attach multiple single prompt agents to a single phone number? For example one agent speaking english and another one spearking mandarin.
a
Thanks for tagging me @jayte2168. I'll look through relevant sources and get back to you shortly.
### Answer --- You cannot directly assign multiple agents to a single phone number. However, there are two approaches to achieve your use case: Option 1: Use Agent Transfer Create a primary agent that detects the user's language preference, then use the Agent Transfer tool to transfer to a language-specific agent. [(1) ]() Agent Transfer offers advantages over call transfer: - Near-instant transition between agents (lower latency) - No separate phone numbers needed for each agent - The destination agent has access to the full conversation history Option 2: Use Inbound Webhook to Override Agent For inbound calls, you can use the inbound webhook to dynamically override the agent ID based on conditions (like detected language) . [(2) ]() Option 3: Single Agent with Language Variable A simpler approach mentioned by users: add language as part of your prompt using a dynamic variable, such as
"You use this language to communicate with the customer: {{language}}."
This works well for outbound calls where you know the customer's language preference beforehand. [(3) ]() For the multi-language scenario specifically, Agent Transfer is the recommended approach since it allows specialized agents for each language while using a single phone number. [(1) ]()
​ To learn more, see the sources I considered: [[1] Agent Transfer](https://docs.retellai.com/build/single-multi-prompt/transfer-agent) [[2] multiple agent for same inbound number](https://discord.com/channels/1186424376300679209/1422923667821826058) [[3] Clarification on Assigning Multiple Agents to a Single Phone Number](https://discord.com/channels/1186424376300679209/1306563900463906880) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
j
@AI Evy What I expect: I have a form to get their name, email, phone number, budget and language, then the agent will call them with their phone number depending on the selected language.
a
Thanks for the follow-up, @jayte2168. I'll get back to you soon.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
​ To learn more, see the sources I considered: [[1] How can I create an outbound call](https://retell.discourse.group/t/how-can-i-create-an-outbound-call/132) [[2] Clarification on Assigning Multiple Agents to a Single Phone Number](https://discord.com/channels/1186424376300679209/1306563900463906880) ​
### Answer For outbound calls where you collect the language preference beforehand via a form, you have two approaches: Option 1: Override Agent ID at Call Time When creating the outbound call via the API, use the
override_agent_id
parameter to specify which language-specific agent should handle the call based on the form data. [(1) ]()
Copy code
javascript
import Retell from 'retell-sdk';

const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;

const phoneCallResponse = await client.call.createPhoneCall({
 from_number: '+14157774444',
 to_number: '+12137774445',
}) ;

console.log(phoneCallResponse.agent_id) ;
In your backend logic, you'd select the appropriate
override_agent_id
(English agent ID or Mandarin agent ID) based on the language field from your form submission. Option 2: Single Agent with Dynamic Language Variable Use a single agent and pass the language as a dynamic variable using
retell_llm_dynamic_variables
. [(1) ]() [(2) ]() You can inject dynamic variables into your prompts, e.g.,
{"customer_name": "John Doe"}
. [(1) ]() A user mentioned this approach: add language as part of the prompt using
"You use this language to communicate with the customer: {{language}}."
— this works well for outbound calls where you know the customer's language preference beforehand. [(2) ]() For your use case (form → outbound call with known language) , Option 1 with separate language-specific agents is cleaner, while Option 2 works if you want a single multilingual agent.