adverse-sapphire
adverse-sapphire2mo ago

Vapi can't use response returned from n8n webhook

I have an n8n workflow that's trigggered by a vapi workflow tool. After the workflow successful run, the response is sent to vapi as shown in first attached image. The issue is, I want to use the response value in the subsequent conversation after the tool run using this ( {{$('tool_1752761204227').item.json.results[0].result}} ) but vapi reads out the literal text instead of interpolating
No description
5 Replies
Sahil
Sahil2mo ago
Extract the value using Vapi’s “Extract Variables” feature like, assign $('tool_xxx').item.json.results[0].result to myResult, then reference it in prompts using {{ myResult }} so vapi interpolates it instead of reading it literally..
adverse-sapphire
adverse-sapphireOP2mo ago
I appreciate your response @Kings_big💫 , would you be kind enough to guide me through how to assign a value to a variable, I've looked around but found nothing on how to
rare-sapphire
rare-sapphire2mo ago
Mapping the JSON path like results[0].result to a variable name like myResult in the tool’s Response Mapping, then use {{myResult}} in later prompts to access its value.. https://docs.vapi.ai/assistants/dynamic-variables
Variables | Vapi
Personalize assistant messages with dynamic and default variables
adverse-sapphire
adverse-sapphireOP2mo ago
This does not work for my workflow case, there are meant for assistant
rare-sapphire
rare-sapphire2mo ago
To use variables in a workflow, you must pass them via assistantOverrides.variableValues when starting the assistant, then reference them in prompts using {{ variableName }}..

Did you find this page helpful?