Issue: Assistant not receiving variables (Name, d...
# support
m
I have a lead qualification workflow where a Vapi assistant (“Sales Agent”) is triggered via an n8n webhook. The assistant collects information from the lead over a phone call and then triggers a tool (update_lead_after_call) that posts call summary and structured data to another n8n webhook for logging and CRM updates. Even though I’m sending variables from n8n in the assistantOverrides.variableValues block, the assistant doesn’t seem to receive them. The assistant doesn’t greet the lead by name even though Name is provided. In the Vapi Call Logs → “Variables” section, the values for Name, Email, and deal_id are all empty. I already defined those variables inside the tool with default empty strings. https://cdn.discordapp.com/attachments/1427227644134424656/1427227644486881351/image.png?ex=68ee18d3&is=68ecc753&hm=326d3a78ecbe0a4cf0956f29826fc90a0a5c6eb57378a09c04da0b67ac396fd7& https://cdn.discordapp.com/attachments/1427227644134424656/1427227645128736778/image.png?ex=68ee18d3&is=68ecc753&hm=05ac8581c83f316b4b1195b6533b3ab59db9dfd857a102d7b7eb26e636732e84& https://cdn.discordapp.com/attachments/1427227644134424656/1427227645505962046/image.png?ex=68ee18d3&is=68ecc753&hm=6de67a7e814d2d74fe4c12480d014179fbaf9822f3da956aa05cc856d722781b& https://cdn.discordapp.com/attachments/1427227644134424656/1427227645862481962/image.png?ex=68ee18d3&is=68ecc753&hm=ed1ef1c0414ab652ae82c83453f89366db236d8898b921e5cbc6bfc9110ff290&
v
Check that your variable names in both the assistant prompt and the
assistantOverrides.variableValues
block match exactly (including case).
For example, if your prompt uses
{{Name}}
, your payload should look like:
Copy code
json
{
  "assistantId": "your-assistant-id",
  "phoneNumber": "+1234567890",
  "assistantOverrides": {
    "variableValues": {
      "Name": "John Doe",
      "deal_id": "12345"
    }
  }
}
Make sure the variable names are identical in both places; otherwise, the assistant will not receive the values. [See more in the documentation.](https://docs.vapi.ai/assistants/dynamic-variables) Source: - [Variables Vapi Documentation](https://docs.vapi.ai/assistants/dynamic-variables)
m
im still waiting
v
I can help you resolve this by ensuring the variables in assistantOverrides.variableValues match those defined under the Assistant’s Variables tab — not just the tool. Vapi only recognizes variables declared there. I’ll also help verify your payload formatting and injection timing. Are your Name, Email, and deal_id currently defined inside the Assistant’s Variables section? @maureen
c
Hi maureen, To ensure that the dynamic variables are set correctly for your assistant, make sure that your JSON payload specifies the
assistantOverrides
with the
variableValues
accurately. Here's an example structure for setting the variables:
Copy code
json
{
  "assistantId": "your-assistant-id",
  "assistantOverrides": {
    "variableValues": {
      "name": "John",
      "email": "john@example.com",
      "deal_id": "12345"
    }
  },
  "customer": {
    "number": "+1xxxxxxxxxx"
  },
  "phoneNumberId": "your-phone-id"
}
Ensure that: - The JSON payload is well-formed and includes all necessary sections. - The call to the
/call/phone
endpoint includes the correct
assistantId
and
phoneNumberId
. For further details, you can refer to the [documentation](https://docs.vapi.ai/assistants/dynamic-variables) on using dynamic variables. If the assistant still doesn't receive the variables, double-check if they appear correctly in the Vapi Call Logs under "Variables" section.
2 Views