Workflow api request with extracted variables
# support
@Vapi
@Vapi Support Bot
@User
k
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..
a
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
k
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..
a
thank youu
one more question , how i can send the call id in the request ?
c
The payload to your webhook URL contains a call object with the call ID. You can extract the call ID from the payload.
a
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" } ]
c
Here is an example Vapi Payload structure:
Copy code
{
  "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
    }
  }
}
a
yes that is what i was expecting, but the snippet i shared is what im actually getting !
c
This looks like a webhook from a different system. Could you please provide a screenshot of the configuration where this is configured in n8n?
l
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
6 Views