How to Use n8n with ._Template 118 Voice Agent Qualificacao Leads Vapi
You are paying for leads and losing most of them in the gap between "form submitted" and "someone actually called them back." A lead that fills out a form at 9:14 PM is 10x colder by 9:00 AM the next
You are paying for leads and losing most of them in the gap between "form submitted" and "someone actually called them back." A lead that fills out a form at 9:14 PM is 10x colder by 9:00 AM the next day when your SDR finally dials. Speed-to-lead is not a nice-to-have — every published benchmark shows that contacting a lead within the first 60 seconds dramatically outperforms contacting them an hour later. But hiring humans to answer inbound at 3 AM, qualify them against BANT criteria, and route only the serious ones to sales is expensive and doesn't scale. This is exactly the gap Template 118 — a Voice Agent for lead qualification built on n8n and Vapi — is designed to close.
The Problem: Manual Qualification Kills Speed and Consistency
Most inbound funnels have the same three leaks. First, latency: leads sit in a queue until a human is available, and by then intent has evaporated. Second, inconsistency: two SDRs qualify the same lead differently, ask different questions, and log different notes, so your CRM data is unreliable. Third, waste: your best closers spend 60–70% of their day on tire-kickers who were never going to buy, because nobody filtered them first.
Text-based chatbots don't solve this — they have terrible completion rates, and high-intent buyers want to talk, not type. What actually moves the needle is a voice agent that answers or calls back instantly, holds a natural conversation, asks the same qualifying questions every time, and hands off only qualified leads to a human. That's a real-time voice AI (Vapi) orchestrated by a workflow engine (n8n) that owns the business logic, the CRM writes, and the routing.
The Solution: n8n as the Brain, Vapi as the Voice
The architecture splits cleanly. Vapi handles the hard real-time media problem — speech-to-text, the LLM turn-taking, text-to-speech, barge-in, and telephony — so you never touch a WebRTC stack. n8n is the orchestration brain: it triggers the call, feeds Vapi the assistant configuration and lead context, receives structured qualification data back, scores it, writes to your CRM, and routes hot leads to a human via Slack, WhatsApp, or a warm transfer.
The key insight in Template 118 is function/tool calling during the call. Vapi doesn't just record a transcript — mid-conversation it can call back into n8n webhooks to look up an account, check calendar availability, or persist a qualification field the moment the caller says it. n8n exposes those as tool endpoints, so the voice agent becomes an active participant in your systems, not a passive recorder.
A qualified lead in this template means structured output: budget range, authority (is this the decision-maker?), a concrete need, and a timeline — classic BANT — plus a numeric intent score. Everything downstream keys off that structured object, not off free-text notes.
Step-by-Step: Building the Workflow in n8n
1. The inbound trigger. Start with a Webhook node set to POST. This is what your lead form, Typeform, or landing page hits on submission. Capture name, phone (in E.164 format — +15551234567), email, and any UTM/source fields in the body. Immediately follow it with a Respond to Webhook node returning 200 so the form doesn't hang while the rest runs asynchronously.
2. Normalize and guard. Add a Set (Edit Fields) node to clean the phone number and a small Code node or Filter node to reject obviously bad data (missing phone, disposable email domains, duplicate submissions within N minutes). This prevents you from burning Vapi minutes on garbage.
3. Launch the outbound call. Use an HTTP Request node to POST https://api.vapi.ai/call. Store your Vapi key in n8n Credentials as a Header Auth credential (Authorization: Bearer <key>) — never hardcode it in the node. The JSON body references a pre-built assistantId and passes dynamic context through assistantOverrides.variableValues, so the agent greets the lead by name and knows what they requested:
{ "assistantId": "asst_...", "phoneNumberId": "pn_...", "customer": { "number": "={{ $json.phone }}" }, "assistantOverrides": { "variableValues": { "leadName": "={{ $json.name }}", "product": "={{ $json.product }}" } } }
4. Design the assistant's system prompt. Inside Vapi, the assistant's model prompt is where qualification actually lives. Give it a tight persona, an explicit question sequence (budget → authority → need → timeline), and instructions to keep turns short and let the caller talk. Critically, define a tool called something like save_qualification whose schema forces the model to emit structured fields. Point that tool's server URL at a second n8n webhook.
5. Receive the qualification (second Webhook). This is the return path. When Vapi calls save_qualification mid-call, or when the call ends and fires an end-of-call-report, it hits your n8n webhook with the transcript and structured data. Add a Switch node on the Vapi event type to branch between live tool-calls and the final report.
6. Score and route. A Code node computes an intent score from the BANT fields (e.g., budget present +30, decision-maker +30, timeline < 30 days +25, clear need +15). Then an IF node splits the flow: score ≥ 70 goes to the "hot" branch — a Slack or WhatsApp node pings the on-call rep, and optionally an HTTP Request triggers a warm transfer or books a slot via a Google Calendar node. Everything else goes to a nurture branch.
7. Persist everything. Both branches end at your CRM node — HubSpot, Pipedrive, Salesforce, or a generic HTTP Request — writing the contact, the qualification fields, the score, and a link to the transcript. Add a Google Sheets or database node as a cheap audit log so you can review agent performance later.
Benefits: What Changes When This Is Live
Sub-60-second response, 24/7. The webhook fires the call within seconds of form submission, at any hour, with no staffing. Perfectly consistent qualification — the same questions, the same scoring, every single lead, which finally makes your CRM data trustworthy for forecasting. Your closers only talk to qualified pipeline, which typically doubles or triples effective selling time. Full auditability — every call has a transcript, a score, and a structured record, so you can A/B test prompts and prove ROI. And because n8n owns the logic, changing the scoring model or adding a new CRM is a node edit, not an engineering project.
Common Pitfalls (and How to Avoid Them)
Synchronous webhook timeouts. Never make the initial form webhook wait for the whole call to finish. Respond 200 immediately and let the return webhook handle results. Otherwise the caller's form hangs and Vapi retries pile up.
Bad phone formatting. Vapi requires strict E.164. A missing country code silently fails the call. Normalize in a Set/Code node and reject numbers that don't match before you spend money on the call.
Idempotency and duplicate calls. Forms get double-submitted and Vapi can retry webhooks. De-duplicate on a call ID or lead phone within a time window using a Code node backed by a datastore, or you'll call the same lead twice and log conflicting records.
Overstuffed prompts. Voice agents degrade when the system prompt is a wall of text. Keep it to a persona, a short ordered question list, and clear tool-use instructions. Push everything else into tools and n8n logic where it belongs.
Leaking credentials. Put the Vapi key and CRM tokens in n8n Credentials, not in node bodies or expressions. Secure your return webhook with a secret header or HMAC signature check so nobody can spoof qualification data into your CRM.
No fallback for no-answer. Most calls won't connect on the first try. Handle Vapi's no-answer/voicemail statuses in your Switch node: schedule a retry with a Wait node, or drop the lead into an SMS/email nurture sequence so it never goes dark.
Start narrow. Deploy on one lead source with a tight scoring rubric, listen to the first 50 transcripts, and tune the prompt and scoring before you point your entire funnel at it. The template gives you the machine — the qualification quality comes from iterating on real calls.