optimistic-gold
optimistic-gold4mo ago

Analysis Plan and Overrides

I'm almost sure that I used to be able to set up variables in the prompt of the analysis plan, but now it doesn't work. I'm using javascript sdk:
await vapiClient.calls.create({
assistantId,
phoneNumberId: vapiPhoneNumbers[phoneNumberIndex],
customer: { number: rawNumber, numberE164CheckEnabled: true },
assistantOverrides: { variableValues: { ...callVariables } },
});
await vapiClient.calls.create({
assistantId,
phoneNumberId: vapiPhoneNumbers[phoneNumberIndex],
customer: { number: rawNumber, numberE164CheckEnabled: true },
assistantOverrides: { variableValues: { ...callVariables } },
});
In my callVariables, I have one called "today", and I have that variable in my Prompt on the Structured Data:
You will be given a transcript of a call and a system prompt for the AI voice assistant. Determine the call was successful and whether the recipient of the call booked a meeting.

Consider today as {{today}}.
You will be given a transcript of a call and a system prompt for the AI voice assistant. Determine the call was successful and whether the recipient of the call booked a meeting.

Consider today as {{today}}.
But that value is completely ignored, the one in the assistant prompt is replaced and works as expected, but my variable in the analysis plan thinks it's 2023.
7 Replies
Vapi
Vapi4mo ago
Currently, dynamic variables (like {{today}}) passed via assistantOverrides.variableValues are only supported in the assistant's system prompt and dashboard messages—not in analysis plan prompts (such as structured data or summary prompts). This matches the behavior you're seeing, where the variable works in the assistant prompt but not in the analysis plan. If you need this feature, I recommend submitting a feature request or reaching out to Vapi support for clarification or to report this as a possible regression. Sources: - Vapi Docs: Dynamic Variables - Vapi Docs: Call Analysis - Vapi Support
⤵️ Mention @Vapi Support Bot for follow-ups 🐥
optimistic-gold
optimistic-goldOP4mo ago
So there's no way I can use dynamic variables in the analysis plan prompt, unless I do it myself?
Vapi
Vapi4mo ago
Correct—currently, there is no built-in way to use dynamic variables in analysis plan prompts. If you need to inject values like {{today}}, you'll have to manually replace them in your prompt string before sending it to Vapi, for example:
const prompt = `...Consider today as ${callVariables.today}.`;
const prompt = `...Consider today as ${callVariables.today}.`;
If this is a critical feature, consider submitting a feature request to Vapi support for future updates. Sources: - Vapi Docs: Dynamic Variables - Vapi Docs: Call Analysis - Vapi Support
Duckie
Duckie4mo ago
Message marked as helpful by @rbrun! 🎉
Shubham Bajaj
Shubham Bajaj4mo ago
checking if this is resolved/solved for you?
optimistic-gold
optimistic-goldOP4mo ago
I had to manually overwrite my variable in the analysis plan prompt in my server. It solved my question, but ideally I feel that this is something that should be a feature in the future.
Shubham Bajaj
Shubham Bajaj4mo ago
Glad the issue was resolved. If you would like to suggest this as a feature, you can suggest it here: https://roadmap.vapi.ai/feature-requests

Did you find this page helpful?