How to Use n8n with ._Template 187 Webhook To Crm Qualificacao Ia
Manual lead qualification is where sales teams quietly bleed hours. A form fills, a webhook fires, and then someone has to read the submission, judge intent, score it, and decide whether it deserves a
Manual lead qualification is where sales teams quietly bleed hours. A form fills, a webhook fires, and then someone has to read the submission, judge intent, score it, and decide whether it deserves a fast follow-up or a nurture sequence. By the time that happens, the lead has cooled. Template 187 — Webhook To CRM Qualificação IA — closes that gap by wiring an inbound webhook straight into an AI qualification step and pushing a scored, enriched record into your CRM without a human touching it. Below is exactly how it works and how to run it in n8n.
The problem: raw leads arrive faster than humans can qualify them
Most inbound funnels dump leads into a CRM in whatever shape the form or ad platform sends them. The record has a name, an email, maybe a free-text "what do you need?" field — and nothing else. There is no priority, no intent signal, no routing logic. A rep opens the CRM, sees fifty new rows, and has no idea which three are worth calling in the next ten minutes.
The consequences compound. High-intent leads sit in the same undifferentiated pile as tire-kickers. Response time — the single strongest predictor of conversion for inbound — stretches from minutes to hours. And because qualification lives in someone's head, it's inconsistent: two reps score the same lead differently, and you can't audit or improve a process you never wrote down. You end up hiring an SDR whose main job is copy-pasting form data and guessing at priority.
The solution: an AI qualification layer between the webhook and the CRM
Template 187 inserts a decision step where there used to be a gap. The flow is linear and fast: a Webhook node receives the raw lead payload the instant a form is submitted, a Set node normalizes the fields, an AI node reads the lead's context and returns a structured qualification (score, tier, reasoning, suggested next action), and a CRM node writes the enriched record. An IF node in the middle routes hot leads to an immediate alert while cold leads flow into nurture.
The key shift is that qualification becomes code, not judgment. You define what "qualified" means once — in a prompt — and every lead is scored against the same rubric, at machine speed, with a written rationale attached. The AI doesn't replace your reps; it hands them a ranked, annotated list so their first action of the day is a call, not triage.
Step-by-step: building the workflow in n8n
Here is the node-by-node configuration. The whole thing is six nodes and runs in under two seconds per lead.
1. Webhook (Trigger) — Add a Webhook node set to HTTP Method: POST and give it a stable path like lead-intake. Copy the production URL and paste it into your form tool, landing page, or ad-platform lead endpoint. Set Respond: Immediately so the submitting form gets a fast 200 and doesn't time out while the AI thinks. If the source can send a secret, validate it with a header check to stop junk traffic.
2. Set (Normalize) — Different sources name fields differently (full_name vs name, company vs org). Use a Set node (or Edit Fields) to map everything into a clean schema: lead_name, email, company, message, source. Reference incoming values with expressions like {{ $json.body.full_name }}. This one node saves you from rewriting the AI prompt every time you add a new lead source.
3. AI Qualification — Add an AI Agent node (or a Basic LLM Chain) connected to a chat-model sub-node such as the Anthropic Claude node. The prompt is the heart of the template. Instruct the model to act as an SDR and return strict JSON — never prose — with these keys: score (0–100), tier (hot/warm/cold), reason (one sentence), and next_action. Feed it the normalized fields:
Qualify this lead. Company: {{ $json.company }}. Message: "{{ $json.message }}". Source: {{ $json.source }}. Score intent 0-100, assign a tier, explain why in one sentence, and recommend the next action. Return only JSON: {"score", "tier", "reason", "next_action"}.
Enable the node's structured-output / JSON parser option so downstream nodes get a real object instead of a string. Keep temperature low (0–0.3) for consistent scoring.
4. IF (Route) — Add an IF node with the condition {{ $json.score }} greater than or equal to 70. The true branch is your hot-lead path; the false branch is nurture. This threshold is a business decision — start at 70 and tune it after you've watched a week of scores.
5. CRM Write — On both branches, add your CRM node (HubSpot, Pipedrive, Salesforce, or an HTTP Request node hitting the CRM API). Create or update the contact and map the AI output into custom fields: ai_score, ai_tier, ai_reason. Now the score lives in the CRM, so reps can sort and filter by it natively.
6. Notify (hot branch only) — On the true branch, add a Slack or Send Email node that pings the sales channel: "🔥 Hot lead: {{ $json.company }} — {{ $json.reason }}. Call now." This is what turns a two-hour response time into a two-minute one.
Test the whole chain by clicking Listen for Test Event on the Webhook node and submitting your form once. Inspect each node's output, confirm the AI returns clean JSON, then Activate the workflow to move it to the production URL.
The benefits: speed, consistency, and a process you can actually improve
The payoff shows up in three places. First, response time collapses — hot leads trigger an alert the moment they submit, not after a rep gets around to the inbox. Second, qualification becomes consistent and auditable: every lead is scored against the same written rubric, and the reason field gives you a paper trail you can review and refine. Third, you reclaim SDR hours — the copy-paste triage job disappears, and reps spend their time on conversations instead of data entry.
There's a compounding benefit too. Because the rubric lives in a prompt, improving your qualification is now a one-line edit, not a retraining meeting. Notice that leads mentioning a competitor convert well? Add that signal to the prompt and every future lead is scored with it — instantly and uniformly.
Common pitfalls (and how to avoid them)
Trusting AI output without a JSON guard. If the model returns prose or malformed JSON, your CRM node fails. Always enable structured output, and add a fallback: an IF or Code node that checks the parse succeeded, routing failures to a manual-review queue instead of dropping the lead.
No idempotency on the webhook. Forms and ad platforms retry. Without a dedup step, one lead becomes three CRM records. Use the email as an upsert key in the CRM node, or store seen IDs so retries update rather than duplicate.
Slow synchronous response. If the Webhook waits for the AI before responding, a slow model call can time the form out. Set the Webhook to respond immediately and let the rest of the flow run asynchronously.
A static score threshold. The 70 cutoff is a starting guess. Log scores for two weeks, compare against which leads actually converted, and move the threshold to match reality — otherwise you're either flooding reps with false hots or burying real ones in nurture.
Leaking secrets. Keep CRM tokens and model API keys in n8n Credentials, never hardcoded in a node. And validate the webhook with a shared secret so nobody can POST fake leads into your pipeline.
Wire this up once and inbound qualification stops being a bottleneck. The webhook fires, the AI scores, the CRM fills in, and your reps wake up to a ranked call list instead of a pile of raw rows.