Hi guys — I’m working on setting up a smart auto attendant using Twilio and Vapi.
Goal:
When someone calls our Twilio number, I want to:
Run custom logic in n8n (check time of day, detect if caller is a known customer)
Then dynamically start a Vapi Assistant with context variables (e.g. routing options, caller type)
What's unclear to me:
Should the “A call comes in” webhook in Twilio point to:
My own n8n instance, so I can run my logic and then forward the call to Vapi?
OR
Directly to
https://api.vapi.ai/twilio/inbound_call, with Vapi handling everything and n8n triggered after via function tools?
Problem I’m hitting now:
When Twilio is set to post directly to my n8n webhook, the call connects but the caller hears an error — likely because Twilio expects a TwiML response, but n8n isn’t providing one.
What I want to know:
Is it possible to intercept and inspect an inbound Twilio call via n8n first, then decide whether or not to start a Vapi call?
Or is the required pattern: Twilio → Vapi webhook → Vapi Assistant (which then uses function tools to call n8n)?
If there’s a recommended pattern for this hybrid logic-based call routing, I’d love to follow it.
i've tried watching videos on youtube but I just cant find the solution