deepak_17078
10/02/2025, 7:09 PMAI Evy
10/02/2025, 7:09 PMAI Evy
10/02/2025, 7:09 PMAI Evy
10/02/2025, 7:09 PMAI Evy
10/02/2025, 7:09 PMdeepak_17078
10/02/2025, 7:12 PMAI Evy
10/02/2025, 7:12 PMAI Evy
10/02/2025, 7:12 PM///## 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 :
///## 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.
...AI Evy
10/02/2025, 7:12 PMAI Evy
10/02/2025, 7:12 PMAI Evy
10/02/2025, 7:12 PMdeepak_17078
10/02/2025, 8:08 PMAI Evy
10/02/2025, 8:08 PMAI Evy
10/02/2025, 8:09 PMAI Evy
10/02/2025, 8:09 PMAI Evy
10/02/2025, 8:09 PMdeepak_17078
10/05/2025, 6:34 PMAI Evy
10/05/2025, 6:34 PMAI Evy
10/05/2025, 6:34 PMjavascript
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 :
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) ]() .AI Evy
10/05/2025, 6:34 PMAI Evy
10/05/2025, 6:34 PMdeepak_17078
10/05/2025, 6:37 PMAI Evy
10/05/2025, 6:37 PMAI Evy
10/05/2025, 6:37 PM/create-batch-call with the following structure :
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) ]() .AI Evy
10/05/2025, 6:37 PMAI Evy
10/05/2025, 6:37 PMdeepak_17078
10/05/2025, 6:40 PMAI Evy
10/05/2025, 6:40 PMAI Evy
10/05/2025, 6:41 PMAI Evy
10/05/2025, 6:41 PMAI Evy
10/05/2025, 6:41 PMAI Evy
10/05/2025, 6:41 PMdeepak_17078
10/05/2025, 7:01 PMAI Evy
10/05/2025, 7:01 PMAI Evy
10/05/2025, 7:01 PMjavascript
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) ;AI Evy
10/05/2025, 7:01 PMtasks 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.AI Evy
10/05/2025, 7:01 PMAI Evy
10/05/2025, 7:01 PMdeepak_17078
10/05/2025, 7:12 PMAI Evy
10/05/2025, 7:12 PMAI Evy
10/05/2025, 7:12 PM/create-batch-call
This endpoint creates a batch call with the following structure :
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 .AI Evy
10/05/2025, 7:12 PMAI Evy
10/05/2025, 7:13 PMAI Evy
10/05/2025, 7:25 PMdeepak_17078
10/05/2025, 7:25 PMAI Evy
10/05/2025, 7:25 PM{{ $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:
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 .AI Evy
10/05/2025, 7:25 PMAI Evy
10/05/2025, 7:25 PMdeepak_17078
10/05/2025, 7:35 PMAI Evy
10/05/2025, 7:35 PMAI Evy
10/05/2025, 7:35 PMtasks 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:
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) ]() .AI Evy
10/05/2025, 7:35 PMAI Evy
10/05/2025, 7:35 PMdeepak_17078
10/05/2025, 7:38 PMAI Evy
10/05/2025, 7:38 PMAI Evy
10/05/2025, 7:38 PM/create-batch-call
You're currently sending to ` which is for individual phone calls, not batch calls .
The correct endpoint for batch calls is:
<https://api.retellai.com/create-batch-call>
Here's the correct API structure for batch calls:
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.AI Evy
10/05/2025, 7:38 PMAI Evy
10/05/2025, 7:38 PMdeepak_17078
10/05/2025, 7:40 PMdeepak_17078
10/05/2025, 7:41 PMAI Evy
10/05/2025, 7:41 PMAI Evy
10/05/2025, 7:41 PM<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?AI Evy
10/05/2025, 7:41 PMAI Evy
10/05/2025, 7:41 PM