https://retellai.com/?utm_source=discord&utm_medium=seo logo
d
@AI Evy Hi. I have creadted prompt trees but the system seems not to follow it, it is somehow going back to the early prompt which I had before which is no longer there
a
Thanks for tagging me @deepak_17078. I'll look through relevant sources and get back to you shortly.
### Answer Based on the available sources, this appears to be a known issue where agents continue using old prompt configurations even after updates [(1) ]() . Community members have reported that while testing shows the new prompt working correctly, live calls still use the previous prompt configuration . One suggested solution from the community is to create a new agent with the updated prompt rather than modifying the existing one . This approach may help ensure the system uses the current prompt tree configuration. When working with multi-prompt agents, it's important to understand that they organize conversations into a structured tree of states, each with its own focused prompt and behavior [(2) ]() . Each state includes focused prompts, state-specific functions, transition logic, and context preservation between states . For complex conversations, multi-prompt structures are recommended over single prompt approaches as they provide predictable behavior, easier debugging, better function control, and scalable design . If the issue persists after creating a new agent, I'd recommend checking out these resources or contacting support: - Visit [Contact Sales]() - Visit [) Would you like a general answer based on my knowledge instead?
​ To learn more, see the sources I considered: [[1] Agent has been updated but still using old prompt tree](https://discord.com/channels/1186424376300679209/1351545466503827587) [[2] Single/Multi Prompt Agent Overview](https://docs.retellai.com/build/single-multi-prompt/prompt-overview) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
d
@AI Evy So after creating the new agent, should I start again with the prompt tree
a
Thanks for the follow-up, @deepak_17078. I'll get back to you soon.
### Answer Yes, when creating a new agent to resolve the prompt tree issue, you'll need to rebuild your multi-prompt structure from scratch [(1) ]() . For your new agent, you can choose between two approaches [(2) ]() : 1. Single Prompt Agent - Uses one comprehensive prompt, best for simple conversations with 1-3 functions 2. *Multi-Prompt Agent (Recommended) * - Organizes conversations into a structured tree of states, each with focused prompts and state-specific functions When building your new multi-prompt tree, each state should include : - **Focused Prompt**: Specific instructions for that conversation phase - **State-Specific Functions**: Only relevant tools available in each state - **Transition Logic**: Clear conditions for moving between states - **Context Preservation**: Variables and information flow between states For effective prompt writing, structure your prompts in sections [(3) ]() :
Copy code
///## Identify
You are a friendly AI assistant for Retell AI. ....
///## Style Guardrails
Be concise: ...
Be conversational: ...
...
///## Response Guideline
Return dates in their spoken forms: ...
Ask up to one question at a time: ...
...
///## Task
1. Greet the user
...
Write your tasks as clear steps to help the LLM understand the conversation flow :
Copy code
///## Task
1. Ask for user's name.
2. Ask if user needs a refund, need a replacement, or just retriving information.
 - if user needs a refund, transition to refund state.
 - if user needs a replacement, transition to replacement state.
3. If user is just retriving information, ask for the order number.
...
This fresh start should resolve the issue of the system using old prompt configurations.
​ To learn more, see the sources I considered: [[1] Agent has been updated but still using old prompt tree](https://discord.com/channels/1186424376300679209/1351545466503827587) [[2] Single/Multi Prompt Agent Overview](https://docs.retellai.com/build/single-multi-prompt/prompt-overview) [[3] Write a single prompt](https://docs.retellai.com/build/single-multi-prompt/write-single-prompt) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
d
@AI Evy I have custom function to set the url, is there another place to set the url in case if I'm not using custom functions
a
Thanks for the follow-up, @deepak_17078. I'll get back to you soon.
### Answer Based on the available sources, custom functions are the primary method for integrating external URLs and APIs with Retell AI agents [(1) ]() [(2) ]() . When you create a custom function, you specify the endpoint URL where Retell will send requests to execute your custom logic [(1) ]() . For custom functions, you need to add the endpoint URL where Retell will send the request to execute your custom function . This URL must be valid, and Retell supports multiple HTTP methods including GET, POST, PUT, PATCH, and DELETE . The sources don't indicate alternative built-in methods for setting URLs outside of custom functions. Custom functions appear to be the standard approach for integrating external systems and APIs with Retell AI agents [(1) ]() [(2) ]() . If you're looking for alternatives to custom functions for specific integrations, Retell AI does offer some built-in function nodes like: - Check Calendar Availability for Cal.com integration [(3) ]() - Built-in telephony features through SIP trunking [(4) ]() However, for general URL-based integrations and API calls, custom functions remain the documented approach [(1) ]() [(2) ]() . If you need to integrate external systems without using custom functions, I'd recommend: - Visit [Contact Sales]() - Visit [
hub.com/RetellAI/]() Would you like a general answer based on my knowledge instead?
​ To learn more, see the sources I considered: [[1] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) [[2] Integrate any system with custom function](https://docs.retellai.com/build/single-multi-prompt/custom-function) [[3] Check Calendar Availability](https://docs.retellai.com/build/check-availability) [[4] Custom Telephony Overview](https://docs.retellai.com/deploy/custom-telephony) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
d
@AI Evy If I give retell some 10 numbers or more as a batch, can it batch by itself to call each number separately or should I give it one number at a time
a
Thanks for the follow-up, @deepak_17078. I'll get back to you soon.
### Answer Yes, Retell AI can handle batch calling with multiple numbers in a single API call [(1) ]() . You don't need to call each number individually - the batch calling feature is specifically designed to handle multiple recipients at once . Here's how you can create a batch call with multiple numbers using the Create Batch Call API :
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const batchCallResponse = await client.batchCall.createBatchCall({
 from_number: '+14157774444',
 tasks: [{ to_number: '+12137774445' }],
}) ;
console.log(batchCallResponse.batch_call_id) ;
The
tasks
parameter is an array where each task represents a single outbound call and includes details such as the recipient's phone number and optional dynamic variables to personalize the call content . You can include multiple tasks in this array for batch processing . Each task can also include
retell_llm_dynamic_variables
to personalize the call content for each recipient :
Copy code
javascript
{ "customer_name": "John Doe" }
The system automatically handles call distribution as concurrency slots become available, making it ideal for large-scale automated campaigns [(2) ]() . Batch Calling queues your calls without hitting concurrency limits, ensuring a seamless experience [(3) ]() .
​ To learn more, see the sources I considered: [[1] Create Batch Call](https://docs.retellai.com/api-references/create-batch-call) [[2] Discord message from @.billyblues on 2025-09-13](https://discord.com/channels/1186424376300679209/1186462578310910112/1416218259568459796) [[3] Platform Changelogs | Retell AI](https://www.retellai.com/changelog) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
d
@AI Evy If I'm calling the retell using n8n webhook, do you know how can I give the batch details thro' the webhook
a
Thanks for the follow-up, @deepak_17078. I'll get back to you soon.
### Answer ### Answer When calling Retell AI's batch call API through n8n webhook, you'll need to structure your webhook payload to match the Create Batch Call API format [(1) ]() . The batch call requires a POST request to
/create-batch-call
with the following structure :
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const batchCallResponse = await client.batchCall.createBatchCall({
 from_number: '+14157774444',
 tasks: [{ to_number: '+12137774445' }],
}) ;
console.log(batchCallResponse.batch_call_id) ;
For your n8n webhook, you'll need to configure the HTTP request node with: Required fields in your webhook payload: - `from_number`: The number you own in E.164 format - `tasks`: An array of individual call tasks, where each task includes
to_number
in E.164 format Optional fields: - `retell_llm_dynamic_variables`: Key-value pairs of strings that inject into your Response Engine prompt and tool description The
tasks
parameter is an array where each task represents a single outbound call and includes details such as the recipient's phone number and optional dynamic variables to personalize the call content . You can include multiple phone numbers in the tasks array for batch processing. The system automatically handles call distribution and queues your calls without hitting concurrency limits [(2) ]() . Authentication: You'll need to include your API key in the Authorization header as "Bearer YOUR_API_KEY" [(1) ]() .
​ To learn more, see the sources I considered: [[1] Create Batch Call](https://docs.retellai.com/api-references/create-batch-call) [[2] Platform Changelogs | Retell AI](https://www.retellai.com/changelog) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
d
@AI Evy so for each call I have a workflow in n8n where it will book the appointment and update some docs, so is this also a possibility with retell batch call
a
Thanks for the follow-up, @deepak_17078. I'll get back to you soon.
### Answer Yes, you can absolutely integrate your n8n appointment booking and document update workflows with Retell AI batch calls using webhooks [(1) ]() [(2) ]() . Retell AI provides real-time webhooks that automatically trigger when specific call events occur [(1) ]() . For your use case, you can set up webhooks to receive instant notifications for [(3) ]() [(2) ]() : - **Call Started**: When the call connects [(3) ]() - **Call Ended**: Final status and duration - **Call Analyzed**: Transcript and analysis ready Here's how webhooks work with your n8n workflow [(1) ]() : 1. **Define an Event**: Choose when the webhook should trigger (e.g., when a call ends or appointment is booked) 2. **Configure a Destination URL**: Point the webhook to your n8n workflow endpoint 3. **Send Structured Data**: When the event happens, the AI agent sends JSON-formatted data to the webhook endpoint 4. **Trigger an Action**: Your n8n workflow receives the data and can book appointments, update documents, or pass information to other systems Webhooks provide real-time updates without polling, making them ideal for production systems [(3) ]() . This means each call in your batch can automatically trigger your n8n workflow to book appointments and update documents as soon as the call completes [(2) ]() . The webhook integration allows your AI voice agents to take real-world actions, integrate with other systems, and create dynamic, personalized workflows
[(1) ]() . With webhooks, your agent can update CRMs with contact details or call summaries, trigger follow-up emails or SMS confirmations, book appointments directly in scheduling tools, and push data into analytics dashboards . This setup gives you seamless automation across tools, reducing manual work and making every call interaction productive .
​ To learn more, see the sources I considered: [[1] Webhook](https://www.retellai.com/glossary/webhook) [[2] Retell AI Webhooks | AI Voice Agents With Live Data | Retell AI](https://www.retellai.com/blog/retell-ai-webhooks-feature) [[3] Outbound Calls (Make Calls)](https://docs.retellai.com/deploy/outbound-call) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
d
@AI Evy can you give me the sample payload for batch call tasks with the following to_number retell_llm_dynamic_variables { "name" "businessType" "email" also in the midst of the call when the user says that this is my preferred time, retell has to communicate to n8n to check if the slot is free otherwise it has to come back and ask for another slot. This dance should happen for a few iterations and once the free slot is available the n8n will book the slot and the retell has to communicate and end the call so in retell I have a custom function with the variables for preferredTime and one more parameter Can all this happen in the batch call
a
Thanks for the follow-up, @deepak_17078. I'll get back to you soon.
### Answer Based on the Retell AI documentation, here's the sample payload for batch call tasks with your specified dynamic variables:
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const batchCallResponse = await client.batchCall.createBatchCall({
 from_number: '+14157774444',
 tasks: [
   { 
     to_number: '+12137774445',
     retell_llm_dynamic_variables: {
       "name": "John Smith",
       "businessType": "Restaurant",
       "email": "john@example.com"
     }
   },
   { 
     to_number: '+12137774446',
     retell_llm_dynamic_variables: {
       "name": "Jane Doe", 
       "businessType": "Retail Store",
       "email": "jane@example.com"
     }
   }
 ]
}) ;
console.log(batchCallResponse.batch_call_id) ;
[(1) ]() Regarding your appointment booking workflow: Yes, all of this can happen within batch calls [(2) ]() . The
tasks
parameter is an array where each task represents a single outbound call and includes details such as the recipient's phone number and optional dynamic variables to personalize the call content [(1) ]() . For your appointment booking scenario: 1. **Dynamic Variables**: You can use dynamic variables like
{{name}}
,
{{businessType}}
, and
{{email}}
in your prompts and tool descriptions [(3) ]() . All values in
retell_llm_dynamic_variables
must be strings . 2. **Custom Functions**: Your custom function with
preferredTime
and other parameters can be called during each batch call to communicate with n8n for slot availability checking . 3. **Real-time Integration**: The system can handle the iterative slot checking process where Retell communicates with n8n, checks availability, and either books the slot or asks for another time preference. For dynamic variables, you can add additional columns in the CSV with custom data for each recipient (e.g., a column header
first_name
can be used as
{{first_name}}
) [(4) ]() . This allows each call in your batch to be personalized with the specific recipient's information while maintaining the same conversation flow and booking functionality.
​ To learn more, see the sources I considered: [[1] Discord message from @.billyblues on 2025-09-13](https://discord.com/channels/1186424376300679209/1186462578310910112/1416218259568459796) [[2] Overview - Batch Calls](https://docs.retellai.com/deploy/make-batch-call) [[3] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[4] Create batch calls](https://docs.retellai.com/deploy/create-batch-call) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
d
@AI Evy so what will be the url for a http call to retell ai for the batch call
a
Thanks for the follow-up, @deepak_17078. I'll get back to you soon.
### Answer The URL for the HTTP call to create a batch call is [(1) ]() : POST
/create-batch-call
This endpoint creates a batch call with the following structure :
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const batchCallResponse = await client.batchCall.createBatchCall({
 from_number: '+14157774444',
 tasks: [{ to_number: '+12137774445' }],
}) ;
console.log(batchCallResponse.batch_call_id) ;
Authentication Required: You'll need to include your API key in the Authorization header as "Bearer YOUR_API_KEY" . HTTP Method: POST Content-Type: application/json The endpoint accepts the required
from_number
and
tasks
parameters, along with optional parameters like
name
,
trigger_timestamp
, and
retell_llm_dynamic_variables
for personalization .
​ To learn more, see the sources I considered: [[1] Create Batch Call](https://docs.retellai.com/api-references/create-batch-call) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
Thanks for the follow-up, @deepak_17078. I'll get back to you soon.
d
@AI Evy I have the http request to retell with the following for the json body { "from_number":"+12367056633", "tasks": [ { "to_number":"{{ $json.Phone }}", "retell_llm_dynamic_variables": { "name":"{{ $json.Name }}", "email":"{{ $json.Email }}", "businessType":"{{ $json.BusinessType }}", "message":"{{ $json['Pain Points'] }}", "UID":"{{ $json.UID }}" } } ] } It says that the request/body must have required property 'to_number'
a
### Answer The issue you're experiencing is likely related to n8n's template variable resolution [(1) ]() . The error suggests that
{{ $json.Phone }}
isn't being resolved to an actual phone number value when the request is sent to Retell AI. According to the Create Batch Call API documentation, the
to_number
field is required and must be a valid phone number in E.164 format . Here's the correct structure:
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const batchCallResponse = await client.batchCall.createBatchCall({
 from_number: '+14157774444',
 tasks: [{ to_number: '+12137774445' }],
}) ;
console.log(batchCallResponse.batch_call_id) ;
Troubleshooting steps: 1. **Verify n8n data structure**: Ensure your incoming data actually contains a
Phone
field with a valid phone number 2. **Check data format**: The phone number must be in E.164 format (e.g.,
+12137774445
) 3. **Test with static values**: Try replacing
{{ $json.Phone }}
with a hardcoded phone number like
"+12137774445"
to confirm the API call works 4. **Debug n8n variables**: Use n8n's debug node to verify what values
{{ $json.Phone }}
is actually resolving to The
to_number
field is required and must contain the phone number you want to call in E.164 format . If using a number purchased from Retell, only US numbers are supported as destination . Your JSON structure looks correct otherwise - the
retell_llm_dynamic_variables
object with your custom fields (
name
,
email
,
businessType
,
message
,
UID
) should work fine for personalizing each call .
​ To learn more, see the sources I considered: [[1] Create Batch Call](https://docs.retellai.com/api-references/create-batch-call) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
d
@AI Evy This is the json body am seding body : from_number : "+12367056633" tasks : Array(1) 0 : retell_llm_dynamic_variables : UID : "2ca998e-d8e5-472e-9191-fb57216275c12" businessType : "Logistics & Transportation" email : "ivdeepak@gmail.com" message : "I want to automate my quotation process" name : "Deepak Venkatachalapathy" [[Prototype]] : Object to_number : "+14167315236" [[Prototype]] : Object length : 1 [[Prototype]] : Array(0) [[Prototype]] : Object
a
Thanks for the follow-up, @deepak_17078. I'll get back to you soon.
### Answer [(1) ]() Your JSON body structure looks correct based on the Create Batch Call API documentation . The payload you're sending has all the required fields: - `from_number`: "+12367056633" (in E.164 format) -
tasks
array with `to_number`: "+14167315236" (in E.164 format) -
retell_llm_dynamic_variables
with your custom fields Here's the expected structure from the documentation:
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const batchCallResponse = await client.batchCall.createBatchCall({
 from_number: '+14157774444',
 tasks: [{ to_number: '+12137774445' }],
}) ;
console.log(batchCallResponse.batch_call_id) ;
Your payload matches this structure correctly. If you're still getting the "required property 'to_number'" error, check: 1. **API Endpoint**: Ensure you're making a POST request to
/create-batch-call
2. **Authentication**: Include your API key in the Authorization header as "Bearer YOUR_API_KEY" 3. **Content-Type**: Set to "application/json" 4. **Phone Number Format**: Both numbers are in E.164 format, which is correct The
retell_llm_dynamic_variables
object with your custom fields (name, email, businessType, message, UID) should work fine for personalizing the call content [(1) ]() [(2) ]() .
​ To learn more, see the sources I considered: [[1] Create Batch Call](https://docs.retellai.com/api-references/create-batch-call) [[2] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
d
@AI Evy This is where I'm sending the POST request to https://api.retellai.com/v2/create-phone-call I do have the Autrorization header with Bearer API_Key and Content_Type as application/json
a
Thanks for the follow-up, @deepak_17078. I'll get back to you soon.
### Answer I found the issue - you're using the wrong API endpoint [(1) ]() . For batch calls, you need to use: POST
/create-batch-call
You're currently sending to ` which is for individual phone calls, not batch calls . The correct endpoint for batch calls is:
Copy code
<https://api.retellai.com/create-batch-call>
Here's the correct API structure for batch calls:
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const batchCallResponse = await client.batchCall.createBatchCall({
 from_number: '+14157774444',
 tasks: [{ to_number: '+12137774445' }],
}) ;
console.log(batchCallResponse.batch_call_id) ;
Your JSON payload structure is correct for batch calls, but you need to change your POST URL to the batch call endpoint . The
/create-phone-call
endpoint expects different parameters for individual calls, which is why you're getting the validation error.
​ To learn more, see the sources I considered: [[1] Create Batch Call](https://docs.retellai.com/api-references/create-batch-call) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
d
I did change it to https://api.retellai.com/create-batch-call and also https://api.retellai.com/v2/create-batch-call both still get me the same error
@AI Evy I did change it to https://api.retellai.com/create-batch-call and also https://api.retellai.com/v2/create-batch-call both still get me the same error
a
Thanks for the follow-up, @deepak_17078. I'll get back to you soon.
### Answer Looking at your error, there might be an issue with the API endpoint URL format. Based on the community discussion, when users experienced similar 404 errors with API endpoints, the solution was to ensure the correct base URL format [(1) ]() . From the Discord community, when a user had API endpoint issues returning 404 errors, the support team recommended using the URL format ` and ensuring correct Authorization header format . Try using this base URL format:
Copy code
<https://api.retellai.com/v2/create-batch-call>
However, if you're still getting the "required property 'to_number'" error specifically, this suggests the request is reaching the API but there's a validation issue. Double-check that: 1. Your n8n workflow is properly serializing the JSON and not sending empty or null values for
{{ $json.Phone }}
2. The phone number format is exactly E.164 (starts with + and country code) 3. There are no extra spaces or characters in the phone number field The batch calling feature allows you to make multiple calls simultaneously by uploading data, and it queues calls without hitting concurrency limits [(2) ]() . Your JSON structure looks correct based on the examples in the community discussions [(3) ]() . If the issue persists, you might want to: - Visit [Contact Sales]() - Visit [) Would you like a general answer based on my knowledge instead?
​ To learn more, see the sources I considered: [[1] API Key Permissions Issue - All Endpoints Return 404](https://discord.com/channels/1186424376300679209/1401947384803754086) [[2] Batch Calling, New Docs, and More Improvements!](https://www.retellai.com/changelog/batch-calling-new-docs-and-more-improvements) [[3] Discord message from @.billyblues on 2025-09-13](https://discord.com/channels/1186424376300679209/1186462578310910112/1416218259568459796) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.