VAPI not interpreting message from webhook
# support
t
Hello everyone I have created an agent and they have a couple tools at their disposal. They call the tools at the correct time and everything seems to be configured correctly. I have the tool set up to send a webhook to n8n then do the workflow and send info back into VAPI. When I see the workflow was completed successfully VAPI shows { "role": "tool_call_result", "tool_call_id": "call_rJznuAqe8e6hEhTgnnq3NDX9", "name": "call_rJznuAqe8e6hEhTgnnq3NDX9", "result": "No result returned.", "time": 1743434033307, "seconds_from_start": 0 } I have tested the tool in postman and postman is able to receive the webhook response message. I know it's likely a configuration in VAPI or maybe the message needs to be specific as well. I have tried to make the response : { "results": [ { "toolCallId": "", "name": "", "result": "Success" } ] } It still doesn't work. When I change the tool to use asynchronous it post a success result but if I change the JSON sent from the webhook it continues to show the success result instead of the updated response. Any thoughts? I have been trying to figure this out for hours!
v
Hi there! 👋 I see you're having trouble with VAPI not interpreting messages from your webhook. I'm unable to pinpoint the exact issue in your specific setup, but I can definitely help with some troubleshooting steps based on common webhook integration issues with VAPI. First, let's look at the JSON format. The format you're using is close, but there might be a small issue. According to the [VAPI documentation](https://docs.vapi.ai/tools/custom-tools), the correct JSON format should be:
Copy code
json
{
  "results": [
    {
      "toolCallId": "call_rJznuAqe8e6hEhTgnnq3NDX9",
      "result": "Your result message here"
    }
  ]
}
Notice that the
toolCallId
needs to match exactly the ID sent by VAPI in the initial request. In your case, that would be
call_rJznuAqe8e6hEhTgnnq3NDX9
from your error message. Regarding the asynchronous behavior you mentioned, this is actually expected! When a tool is set to
async: true
, VAPI [automatically sends back](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1342336047589359618) a "tool_call_result" message with "Success," which can interfere with your custom response. Here are some additional troubleshooting steps: 1. **Check Content-Type Header**: Make sure your webhook response has the
Content-Type: application/json
header set correctly. 2. **Verify Webhook URL**: Double-check that the webhook URL in VAPI matches exactly with the one provided by n8n, without any typos or extra spaces. 3. **Check Server Logs**: Review your n8n logs to see if there are any errors or messages that could indicate what's going wrong. 4. **Test with a Simpler Scenario**: Try simplifying your n8n workflow to the bare minimum to test the connectivity. 5. **Check Case Sensitivity**: According to [user reports](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1341204221826957432), VAPI webhook logs use snake_case while server logs use camelCase, which can cause issues.
6. **Try Non-Async Mode**: If possible, set your tool to synchronous mode (not async) to see if that resolves the issue. Is there anything specific in these steps you'd like me to elaborate on further? Sources: - [VAPI documentation](https://docs.vapi.ai/tools/custom-tools) - [Discord thread on async behavior](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1342336047589359618) - [Discord thread on case sensitivity](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1341204221826957432)
s
Hey! To help track down this issue, could you share: - The call ID This would really help us figure out what went wrong!
t
hello everyone! I was able to figure it out and turns out Vapi is quite particular as to what it will except as the return. So with wrapping the result in first JSON.stringify it accepts it now 🙂 { "results": [ { "toolCallId": "{{ $('Edit Fields1').item.json.ID }}", "result": "{{ JSON.stringify($json.message.content).replace(/"/g, " ") }}" } ] } Hope this insight helps anyone else with a similar issue and can save you a few hours
s
Marking this ticket as Solved ✅
2 Views