Issue with Variable Substitution in Voice Response
# support
u
Hi Vapi Support Team, I’m reaching out regarding an issue where the voice bot says “offer range is offer range” instead of speaking the actual value, even though the webhook is returning the correct data. Use Case: We’re calling prospects who submitted their car details on our website for a valuation and may be interested in selling. The goal is to collect car details (make, model, year, etc.), give them an estimated offer range via webhook, and schedule a car inspection if they’re interested. After the inspection, they receive a final offer. What’s working fine: The entire flow is built in N8N The webhook is triggered correctly with the right inputs Google Sheets returns the correct offer range (e.g., 115 to 135 thousand dirhams) The data is passed back cleanly to the Respond to Webhook node I’ve added a tool called get_offer_range with a clear description about expected output The system prompt includes explicit instructions not to say variable names, along with 10 real examples of how to pronounce the offer range naturally The issue: Despite all that, the voice bot still says: “Based on your car’s details, the estimated offer range is offer range.” Only when you ask it something like “What does that mean?” does it respond correctly with: “Sorry, the offer range is 115 to 135 thousand dirhams.” I've attached: A PDF with the relevant section of the system prompt where this is explained clearly Screenshots showing correct webhook execution and returned data Could you please look into why this placeholder variable isn’t being replaced consistently during the natural dialogue? It’s blocking the main value moment of the call. Thanks in advance for your help! Best regards, Mohammad Samir https://cdn.discordapp.com/attachments/1372108625534910464/1372108626101276702/Proof_2.png?ex=6825933d&is=682441bd&hm=50a771680d7862314db8b2da41874fd06ff50c2a3e5a352402094a7dc30c15d4& https://cdn.discordapp.com/attachments/1372108625534910464/1372108626419912755/proof_3.png?ex=6825933d&is=682441bd&hm=1c89aa2e94c9419024605b9d608c1c9e5d17d13caf3e1c0726a0263b1505a366& https://cdn.discordapp.com/attachments/1372108625534910464/1372108626759647314/proof_4.png?ex=6825933d&is=682441bd&hm=f2e23fd425ba94699f85e65c97b53bfb6a674625fa75cbb52cfe7aa6c32a96ea& https://cdn.discordapp.com/attachments/1372108625534910464/1372108627384733766/proof_5.png?ex=6825933d&is=682441bd&hm=007a0a750100a8275ced8ec3e254ff969bba9592d9a61e8e4c51aabe5846a5e1& https://cdn.discordapp.com/attachments/1372108625534910464/1372108627657097277/proof_6.png?ex=6825933d&is=682441bd&hm=1b04671a0e85e8fdb85f9eaeadef28cdf88ce2dce7f829f53bcabb51d0727e65& https://cdn.discordapp.com/attachments/1372108625534910464/1372108627929858090/proof_7.png?ex=6825933d&is=682441bd&hm=5bafe912c0d7d767472f92194c4a6e2cf21921aeb057d208356c70d2bf29e311& https://cdn.discordapp.com/attachments/1372108625534910464/1372108628227788920/proof_8.png?ex=6825933d&is=682441bd&hm=7d39a939403675942bcddcee6972f648be8908178ec28bde58fc40d5d6bb07e7&
v
This is a known limitation in Vapi: variable substitution in tool calls and Blocks can fail, causing the bot to say the variable name instead of its value. To maximize your chances of success, ensure your webhook response is formatted like this:
Copy code
json
{
  "results": [
    {
      "result": "Based on your car’s details, the estimated offer range is 115 to 135 thousand dirhams."
    }
  ]
}
If the issue persists despite correct formatting, it is due to a current Vapi bug with no guaranteed workaround; the team is working on a fix but Blocks are not production-ready yet [documentation](https://docs.vapi.ai/assistants/dynamic-variables). Sources: - [Vapi documentation on dynamic variables](https://docs.vapi.ai/assistants/dynamic-variables) - [Vapi Discord user reports and acknowledgments](https://discord.com/channels/1211482211119796234/1321375442644762625)
The most common cause of this issue is a mismatch between the variable name in your prompt (e.g.,
{{offer_range}}
) and the key in the
variableValues
object sent to Vapi. Double-check that you are passing the variable like this in your API or SDK call:
Copy code
json
"assistantOverrides": {
  "variableValues": {
    "offer_range": "115-135 thousand dirhams"
  }
}
Make sure the prompt uses
{{offer_range}}
exactly, and the key in
variableValues
matches it character-for-character. This should resolve the placeholder not being replaced in the voice response ([Vapi documentation](https://docs.vapi.ai/assistants/dynamic-variables)). Source: - [Vapi documentation: Dynamic Variables](https://docs.vapi.ai/assistants/dynamic-variables)
v
Message marked as helpful by @urusamir! 🎉
u
@User @Vapi Support Bot when will this bug get resolved
v
At this time, there is no official timeline or ETA for when the Vapi variable substitution bug will be resolved. The Vapi team has acknowledged the issue and is working on a fix, but no further details have been provided in the documentation or support channels. We recommend monitoring the [Vapi changelog](https://docs.vapi.ai/changelog) and [Discord support channel](https://discord.com/channels/1211482211119796234/1321375442644762625) for updates. Sources: - [Vapi documentation: Dynamic Variables](https://docs.vapi.ai/assistants/dynamic-variables) - [Vapi Discord user reports and acknowledgments](https://discord.com/channels/1211482211119796234/1321375442644762625) - [Vapi changelog](https://docs.vapi.ai/changelog)
The Vapi variable substitution bug is a known issue, and the Vapi team is actively working on a fix. However, there is currently no information or timeline available for when this bug will be resolved. Blocks are not considered production-ready due to this limitation. For updates, you can monitor the [Vapi documentation](https://docs.vapi.ai/assistants/dynamic-variables) and [Vapi Discord](https://discord.com/channels/1211482211119796234/1321375442644762625). Sources: - [Vapi documentation on dynamic variables](https://docs.vapi.ai/assistants/dynamic-variables) - [Vapi Discord user reports and acknowledgments](https://discord.com/channels/1211482211119796234/1321375442644762625)