Dynamic Variables in outbound not working
# support
u
I'm building an outbound caller. The agent is setup in the VAPI dashboard. From n8n I use an HTTP request with assistant id. For customer data, I'm using variables that I'm sending in the JSON body. I'm using those as variables in my prompt and initial message. Attached below is my JSON. The issue is that in the call the agent isn't recognizing the values of the variables sent from the HTTP call. In both the API Logs in the VAPI Dashboard and in my webhook payload for the
end-of-call-report
it shows that variableValues have been received under assistantOverrides. The values are just not appearing in the prompt nor the intitial message. Also, I can't see the values or metadata in the Call logs in the VAPI Dashboard.
Copy code
{
  "assistantId": "ASSISTANT_ID",
  "phoneNumberId": "PHONE_NUMBER_ID",
  "customer": {
    "numberE164CheckEnabled": true,
    "name": "NAME_HERE",
    "number": "NUMBER_HERE",
    "assistantOverrides": {
      "metadata": {
        "Odoo Contact ID": "ODOO_ID_HERE",
        "Call Sequence": "first"
      },
      "variableValues": {
        "parent_name": "PARENT_NAME_HERE",
        "player_name": "PLAYER_NAME_HERE",
        "player_dob": "DOB_HERE",
        "player_level": "Advanced",
        "selected_program": "PROGRAM_NAME_HERE",
        "client_budget": "2000€ to 3000€",
        "program_country": "Spain",
        "program_month": "July",
        "program_duration": "2 Weeks",
        "primary_objective": "Improve football",
        "program_level": "Beginner",
        "program_price": "2,995€"
      }
    }
  }
}
> Call IDs: -
019cba5f-f1ac-7220-acec-df6a993c7e84
-
019cba4e-581f-7aad-973b-11226a1540e0
v
Thanks for sharing the details and JSON. To help diagnose the issue: Can you confirm whether your assistant's system prompt and initial message in the VAPI dashboard explicitly include the variable placeholders (e.g.,
{{parent_name}}
,
{{player_name}}
, etc.)? According to the documentation, these placeholders must be present in your prompt/messages for the dynamic values to appear during the call ([see docs](https://docs.vapi.ai/assistants/dynamic-variables)). If they're missing, the variables won't be substituted even if the values are received correctly. Source: - [Variables Vapi Documentation](https://docs.vapi.ai/assistants/dynamic-variables)
u
Yes. Here's my first message:
Copy code
Hi {{parent_name}}, this is Company-name-here calling about {{player_name}}’s enquiry. Do you have 2 minutes now?
Here's the section of my prompt that includes the dynamic variables:
Copy code
# Context & Dynamic Variables
You are calling based on a form submission. Use these variables when provided:

 ## Customer's Selection
- **Parent:** {{parent_name}}
- **Player:** {{player_name}}
- **Player DOB:** {{player_dob}}
- **Player Level (self-reported):** {{player_level}}
- **Primary Objective:** {{primary_objective}}
- **Budget:** {{client_budget}}

 ## Selected Program Info:
- **Selected Program:** {{selected_program}}
- **Program Country:** {{program_country}}
- **Duration:** {{program_duration}}
- **Month:** {{program_month}}
- **Program Level**: {{program_level}}
- **Program Price**: {{program_price}}

## Other info
- The current date and time in UTC is {{now}}
- Today's day is {{"now" | date: "%A"}}
c
Hey, You are placing assistantOverrides in the wrong location, assistantOverrides must be at the top level of the /call request, not inside customer. Please check the doc for more details: https://docs.vapi.ai/squads
u
Ok, thanks. I'll try that. Though, in the docs, the customer object also had assistantOverrides. I'll try this and let you know.
@Oshi Raghav Yes, that's working now. Thanks. Strange though why in the docs the customer object also has assistanOverrides, and what the prupose of that? See attached image. https://docs.vapi.ai/api-reference/calls/create https://cdn.discordapp.com/attachments/1478884037409116356/1479038632579960924/image.png?ex=69aa9591&is=69a94411&hm=0300e431737827df90455bc6e1e07482404bf7ea258b3207db60ffe69a18680d&
c
Hi,
assistantOverrides
allows you to override parts of the assistant configuration for a specific call without changing the base assistant. It is typically used when creating a call with
POST /call
to modify behavior for that single call. Common fields that can be overridden include: •
transcriber
model
voice
firstMessage
variableValues
When used inside
customer.assistantOverrides
, it applies only to that specific customer in a batch call (
customers: [...]
). When used at the top-level
assistantOverrides
, it applies to the entire call. Best regards, Oshi Raghav Customer Support Team | Vapi
3 Views