correct-apricot
correct-apricot6mo ago

Workflow api request with extracted variables

How i can send extracted variables in the api request node in the body payload section ?
No description
13 Replies
correct-apricot
correct-apricotOP6mo ago
@Vapi @Duckie @Vapi Team
loud-coral
loud-coral6mo ago
Extract variables in a Conversation node, then use {{variable_name}} in the API Request node’s body payload; map API responses to output variables for use in later nodes..
loud-coral
loud-coral6mo ago
Workflows quickstart | Vapi
Build a simple agent that greets users and gathers basic information using Vapi workflows.
Variables | Vapi
Personalize assistant messages with dynamic and default variables
correct-apricot
correct-apricotOP6mo ago
thanks for your response, super clear on how to include them in the api request, not so sure on how to map api responses to output variable
loud-coral
loud-coral6mo ago
By defining them in the API Request node’s Response Mapping section using JSON paths like, subscription_id → data.id, then use {{subscription_id}} in later nodes..
correct-apricot
correct-apricotOP6mo ago
thank youu one more question , how i can send the call id in the request ?
Kyle
Kyle6mo ago
The payload to your webhook URL contains a call object with the call ID. You can extract the call ID from the payload.
correct-apricot
correct-apricotOP6mo ago
this is the payload i get , no call id [ { "headers": { "host": "n8n-aibaze.onrender.com", "user-agent": "node", "content-length": "77", "accept": "/", "accept-encoding": "gzip, br", "accept-language": "*", "authorization": "test", "baggage": "sentry-environment=production,sentry-public_key=a0021577936aec367b16615ad816c078,sentry-trace_id=949fb076a1174bc0af69e7dd91c08010", "cdn-loop": "cloudflare; loops=1", "cf-connecting-ip": "44.247.30.108", "cf-ipcountry": "US", "cf-ray": "951a65d57cc8ef5f-PDX", "cf-visitor": "{"scheme":"https"}", "content-type": "application/json", "render-proxy-ttl": "4", "rndr-id": "81fb3e0a-18c6-46d4", "sec-fetch-mode": "cors", "sentry-trace": "949fb076a1174bc0af69e7dd91c08010-9a7c150ab17e9dd4", "traceparent": "00-760823de7a2a5049f0555f84088c5e5e-09fcbe6553f2b571-01", "true-client-ip": "44.247.30.108", "x-forwarded-for": "44.247.30.108, 172.68.175.33", "x-forwarded-proto": "https", "x-request-start": "1750245630384738" }, "params": {}, "query": {}, "body": { "scheduled_date": "2023-06-20T00:00:00", "candidate_email": "thomas@gmail.com" }, "webhookUrl": "https://n8n-aibaze.onrender.com/webhook/281d9a17-3839-4f09-92", "executionMode": "production" } ]
Kyle
Kyle6mo ago
Here is an example Vapi Payload structure:
{
"message": {
"type": "status-update",
"status": "in-progress",
"call": {
"id": "f47ac10b-58cc-4372-a567-0e02b2c3d479", // ← Call ID here
"orgId": "your-org-id",
"assistantId": "your-assistant-id",
"customer": {
"number": "+1234567890"
},
"metadata": {
"customId": "your-custom-id"
},
"startedAt": "2023-06-20T10:30:00.000Z",
// ... other call properties
}
}
}
{
"message": {
"type": "status-update",
"status": "in-progress",
"call": {
"id": "f47ac10b-58cc-4372-a567-0e02b2c3d479", // ← Call ID here
"orgId": "your-org-id",
"assistantId": "your-assistant-id",
"customer": {
"number": "+1234567890"
},
"metadata": {
"customId": "your-custom-id"
},
"startedAt": "2023-06-20T10:30:00.000Z",
// ... other call properties
}
}
}
correct-apricot
correct-apricotOP6mo ago
yes that is what i was expecting, but the snippet i shared is what im actually getting !
Kyle
Kyle6mo ago
This looks like a webhook from a different system. Could you please provide a screenshot of the configuration where this is configured in n8n?
metropolitan-bronze
metropolitan-bronze2mo ago
Did you ever figure this out? I have the same problem. My api request payload looks just like yours. I can't get it to use any of the default variables in the api request either, the payload that I receive just contains the literal variable name (i.e., "{{now}}" or "{{customer.number}}", etc) instead of the value that is supposed to replace the variable. The difference in payload structure seems to be that the OP is showing the payload of an API Request and Kyle is showing the payload of a tool call. The id is not present in an API Request
Kyle
Kyle3w ago
I sincerely apologize for the delayed response to your support request. We implemented better tracking for support tickets to ensure timely responses going forward, but due to a technical limitation, this only applies to tickets created after this past week. I'm closing this older ticket, but if your issue still needs attention, please: Reply with 'REOPEN' or Email support@vapi.ai with any updates I'll personally ensure your new request gets prompt attention. Thank you for your patience. Best regards, Vapi Support Team

Did you find this page helpful?