Configuring a return from an API Request within a ...
# support
g
I'm having trouble setting up a return from an API Request within a workflow. See the image below to see what I've set up. This is my webhook response from n8n: [ { "nome": "Jhon" } ] My Vapi workflow doesn't receive the return. It ends the test call with an error. https://cdn.discordapp.com/attachments/1367154099107139654/1367154099308724224/image.png?ex=68138cf9&is=68123b79&hm=1bc935fc0b71a3207de655ab63ac1a6a344e2d948a7e3053350555222a81128a&
v
The issue is that your API key configuration doesn't match the JSON structure from n8n. Your webhook returns an array with an object containing a
name
property, but your configuration is looking for a
nome
key. Try updating your Output Values configuration to:
Copy code
Key: [0].name
Target: clienteNome
Type: String
This extracts the
name
value from the first object in the array. Source: - [API Request Task Overview](https://docs.vapi.ai/workflows/tasks/api-request)
The issue is that your API key configuration doesn't match the JSON structure from n8n. Your webhook returns an array with an object containing a
name
property, but your configuration is looking for a
nome
key. Try updating your Output Values configuration to:
Copy code
Key: [0].name
Target: clienteNome
Type: String
This extracts the
name
value from the first object in the array. Source: - [API Request Task Overview](https://docs.vapi.ai/workflows/tasks/api-request)
The issue is likely with your webhook response format. Your n8n webhook is returning an array with a "name" field, but your API Request is looking for a "nome" field. Try one of these solutions: 1. Modify your n8n webhook response to match your Vapi configuration:
Copy code
json
[
   {
      "nome": "Jhon"
   }
]
2. Or update your Vapi configuration to match the n8n response: - Change Key from
nome
to
name
Make sure the JSON structure matches exactly what your API Request is configured to extract. Sources: - [Vapi API Request Documentation](https://docs.vapi.ai/workflows/tasks/api-request) - [Discord Discussion on API Request Issues](https://discord.com/channels/1211482211119796234/1335230139252080691)
The issue is likely with your webhook response format. Your n8n webhook is returning an array with a "name" field, but your API Request is looking for a "nome" field. Try one of these solutions: 1. Modify your n8n webhook response to match your Vapi configuration:
Copy code
json
[
   {
      "nome": "Jhon"
   }
]
2. Or update your Vapi configuration to match the n8n response: - Change Key from
nome
to
name
Make sure the JSON structure matches exactly what your API Request is configured to extract. Sources: - [Vapi API Request Documentation](https://docs.vapi.ai/workflows/tasks/api-request) - [Discord Discussion on API Request Issues](https://discord.com/channels/1211482211119796234/1335230139252080691)
The issue is a data format mismatch. Your n8n webhook returns
name
but your Vapi workflow is looking for
nome
. Try this fix:
Copy code
json
// Change your Output Values configuration in Vapi to:
Key: name  // Instead of "nome"
Target: clienteNome
Type: String
Alternatively, modify your n8n webhook to return
nome
instead of
name
in the response JSON. Source: - [Troubleshooting issues with API requests within Vapi workflows](https://discord.com/channels/1211482211119796234/1336345690393149452)
The issue is a data format mismatch. Your n8n webhook returns
name
but your Vapi workflow is looking for
nome
. Try this fix:
Copy code
json
// Change your Output Values configuration in Vapi to:
Key: name  // Instead of "nome"
Target: clienteNome
Type: String
Alternatively, modify your n8n webhook to return
nome
instead of
name
in the response JSON. Source: - [Troubleshooting issues with API requests within Vapi workflows](https://discord.com/channels/1211482211119796234/1336345690393149452)
g
Actually, I made a mistake when writing the text. My configuration is already correct, but I still have the problem. This is my webhook response from n8n: [ { "nome": "Jhon" } ]
c
Hey! To help track down this issue, could you share: - The call ID - When exactly this happened (the timestamp) - What response you expected to get - What response you actually got instead This would really help us figure out what went wrong!
g
Hello. Thank you for your attention. Here is the information. The call ID: 9b5e4548-aa4b-4be1-b435-cf1095424d90 When exactly this happened (the timestamp): 30 de abr. de 2025, 12:19 What response you expected to get: Esperava obter "jhon" durante a conversa. What response you actually got instead: None
c
Hey, I just looked into your shared call ID, its logs, and the workflow, and I think you have shared a wrong call ID mistakenly. The response you are expecting is not coming out of any of the nodes or even the API request node. Could you correct me if I am wrong here, or if there is any misunderstanding? For now, the workflow has worked according to your defined nodes.
g
I'll try to explain in more detail. I have an API Request node in my VAPI workflow that makes a webhook call in n8n, which in turn makes a query in a database and returns the client name to the VAPI workflow. The API Request node is calling my webhook normally. However, the webhook response is not returning to my workflow. See the prints of the workflow (API Request node) and the webhook return in N8N. In my test, I expect to receive the client "jhon" as a response, which would be used in my last node of the workflow: "Ok. Vamos continuar {{ clienteNome }}?" {{ clienteNome }} = jhon https://cdn.discordapp.com/attachments/1367154099107139654/1367687471420149831/workflow_vapi.png?ex=68157db7&is=68142c37&hm=6a2adbc1bdbf4a83b48af2b2da241982cf1922c3a436d2b891dc30f1e84597f2& https://cdn.discordapp.com/attachments/1367154099107139654/1367687471671803944/workflow_n8n.png?ex=68157db7&is=68142c37&hm=2c7f3773e1d3163bdef1336fcf5dfd110b287af06ecf18ce0e645d9d96b055a2& https://cdn.discordapp.com/attachments/1367154099107139654/1367687471999221780/reponse_n8n_webhook.png?ex=68157db7&is=68142c37&hm=c7cc1b12d7d4632ab10e5277ae403cc3eaf9d6be2b9f42b169cf41f0ea8916e0&
c
Hey @Gsoares, can you turn off the node to run in the background of the conversation? Once you make the change, the node will wait for the API request to resolve before using the response in the next generated response.
Also apologies for the delay.
2 Views