Is there a way to detect when a tool is not called...
# support
w
My problem is the following: I created a call agent and integrated it with n8n. From the webhook, I call some functions in the tools (for scheduling and other tasks) and also store data in my database. What I need to know is this: if I disable my n8n instance or if it goes down, is there any way to detect that it’s offline and say something else? Because when I tested it, I turned off my n8n and spoke with the agent, and it continued through the flow, but without calling the webhook. If that happens, I’d like to either end the call or send a maintenance message (or something similar).
v
You can use an assistant hook to detect when a tool call fails (such as when your n8n webhook is offline) and respond accordingly. For example, add a hook for
call.ending
with a filter for
call.endedReason
set to
"pipeline-error"
, and have the assistant say a maintenance message or end the call:
Copy code
json
{
  "hooks": [{
    "on": "call.ending",
    "filters": [{ "type": "oneOf", "key": "call.endedReason", "oneOf": ["pipeline-error"] }],
    "do": [
      { "type": "say", "exact": "Sorry, our scheduling system is currently under maintenance. Please try again later." },
      { "type": "tool", "tool": { "type": "endCall" } }
    ]
  }]
}
This will ensure users are notified if your tool/webhook is unavailable, providing a better experience. Source: - [Assistant hooks documentation](https://docs.vapi.ai/assistants/assistant-hooks)
w
I did exactly like that, and it still didn’t work. I disabled my n8n flow and made the call, but the agent still followed the flow to make the booking instead of returning the error message I added.
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!
3 Views