How to Automate Lead Qualification with AI and n8n

Most lead qualification systems do one of two things badly. They score leads on firmographic data — company size, industry, job title — which tells you who someone is but not whether they actually have the problem you solve. Or they rely on a sales person reading every form submission and making a judgement call, which is slow, inconsistent, and does not scale.
This post covers a five-step n8n workflow that fixes both problems. It enriches leads with company data, scores them using a prompt built around behavioural signals, updates your CRM, and notifies your team in Slack — all within two minutes of a form submission. The workflow JSON is included at the end. You can import it and adapt it to your stack.
Why Lead Qualification Is the Right Process to Automate First
Response time within the first hour of an inbound enquiry is the strongest predictor of conversion for service businesses — leads contacted within an hour are significantly more likely to convert than those reached hours later. [SOURCE NEEDED: verify lead response time conversion stat against current Salesforce or HubSpot research before publishing] Manual qualification cannot consistently deliver that response time at any significant volume.
How AI lead generation feeds into a qualification workflow covers the top-of-funnel picture — how to generate inbound leads with AI. This post picks up where that one ends: once leads are arriving, how do you qualify them at scale without a dedicated SDR team.
Our lead qualifier use case covers what a production lead qualification system looks like across different business types. The workflow in this post is the buildable version of that — a starting point you can extend rather than a finished product.
Three reasons lead qualification consistently delivers strong automation ROI:
- High volume of similar inputs — every form submission has the same structure
- Clear decision logic — qualify or not, route to A or B, notify person X
- Time-sensitive output — slow qualification directly costs revenue
The goal of the workflow below is not to replace the human sales conversation. It is to ensure that conversation only happens with leads worth having, and that it happens fast.
How the Workflow Is Structured Before You Build
The five steps run sequentially, triggered by a single form submission. Each step either enriches or acts on the data from the step before it. Nothing requires manual intervention until a qualified lead triggers the Slack alert.
The five steps are: capture and parse the form submission, enrich the lead with company and contact data, score the lead with an AI prompt, update the CRM record with the score and enrichment data, and send the Slack notification to the right person.
Why n8n is the right tool for complex multi-step automation workflows covers the platform selection reasoning in detail. The short version for this workflow: you need conditional branching based on score thresholds, HTTP requests to enrichment APIs, and a structured JSON output from the AI step that maps cleanly to CRM fields. n8n handles all three without hitting the limitations that Make and Zapier hit at this level of complexity. How n8n compares to Make and Zapier for this type of workflow covers the specific capability differences that matter for production qualification systems.
How we build custom lead qualification and routing workflows for UK agencies covers what a more advanced version of this looks like when it needs to integrate with a client’s existing CRM, outbound sequence, and reporting stack.
Before building, confirm three things: which form tool you are using (Typeform, Tally, and native HubSpot forms all work with this workflow via webhook), which CRM you are updating (the workflow is built for HubSpot but the CRM step swaps cleanly to Pipedrive or any CRM with a REST API), and which Slack channel receives qualified lead alerts.
Step 1: Capture and Parse the Form Submission
The workflow starts with a Webhook node in n8n set to receive POST requests. Point your form tool’s submission webhook at the n8n URL.
The Webhook node receives the raw form payload. A Set node immediately after it extracts and renames the fields you need into clean variable names. This normalisation step matters because enrichment and scoring APIs expect clean inputs, and form payloads vary significantly in structure depending on the tool.
The minimum fields to extract at this stage:
lead_name— full name from the formlead_email— email addresslead_company— company name (if collected)lead_message— the free-text field where the lead described their problemlead_source— the page or campaign the form was onsubmission_timestamp— ISO format, for CRM logging
The lead_message field is the most important input in the entire workflow. It is the behavioural signal — what the lead actually said in their own words — that the AI scoring prompt uses to distinguish a genuine prospect from a time-waster. Forms that do not collect a free-text message field should add one before this workflow is worth building. “Tell us about your situation” or “What problem are you trying to solve” produce better qualification signal than any firmographic question.
Step 2: Enrich the Lead with Company and LinkedIn Data
With the parsed form data available, the enrichment step adds external data the form did not collect. Two enrichment sources cover most use cases: an email enrichment API for contact and company data, and a company data API for firmographic context.
For email enrichment, Apollo.io and Clearbit both offer APIs that return job title, LinkedIn URL, company name, company size, industry, and location from an email address. An HTTP Request node in n8n calls the enrichment API with lead_email as the input and maps the response fields to new variables: contact_job_title, company_size, company_industry, company_country.
The enrichment step runs with error handling. If the API returns no match — common for personal email addresses or very small companies — the workflow continues with the form data only. The scoring prompt is written to handle missing enrichment data gracefully.
Add a short Wait node (two to three seconds) after the enrichment call if you are on a free or low-tier API plan. Rate limiting on enrichment APIs is the most common cause of intermittent failures in this workflow at higher volumes.
Step 3: Score the Lead with an AI Prompt
The scoring step is where most competitor implementations fall short. They score on firmographic data — company size above 50 employees, industry match, job title level — and miss the signal that is actually predictive: what the lead said about their problem.
A lead from a ten-person company who described a specific, urgent, well-understood problem is almost always a better prospect than a lead from a hundred-person company who submitted a vague enquiry. The AI scoring prompt below is built around that insight.
The n8n node is an OpenAI node (or HTTP Request node calling the Claude or GPT-4o API directly). The prompt is structured as a system message defining the scoring criteria and a user message containing the lead data.
AI Scoring Prompt Template:
System:You are a lead qualification specialist for a UK AI automation agency. Your job is to score inbound leads from 1 to 10 based on how likely they are to become a paying client.Score based on the following criteria:BEHAVIOURAL SIGNALS (weight: 60%)- Problem specificity: Does the lead describe a specific, named problem rather than a vague interest? (+3 if highly specific, +1 if somewhat specific, 0 if vague)- Urgency language: Does the message contain words suggesting urgency or active evaluation? ("currently", "trying to", "need to", "struggling with") (+2 if present)- Budget awareness: Does the message suggest familiarity with cost or investment? (+1 if present)- Fit signal: Does the problem described match what an AI automation agency can solve? (+2 if strong match, +1 if partial match, -2 if poor match)FIRMOGRAPHIC SIGNALS (weight: 40%)- Company size: 10-200 employees (+1), 200+ employees (+1), under 10 (0), unknown (0)- Job seniority: Owner, Director, Head of (+1), Manager (0), unknown (0)- Industry: Professional services, agency, recruitment, accountancy (+1), other (0)OUTPUT FORMAT:Return only valid JSON with these exact fields:{ "score": [integer 1-10], "tier": ["hot" if score 8-10, "warm" if score 5-7, "cold" if score 1-4], "score_reason": [one sentence explaining the score], "recommended_action": ["call within 1 hour" if hot, "email within 4 hours" if warm, "add to nurture sequence" if cold]}User:Lead name: {{lead_name}}Company: {{lead_company}}Job title: {{contact_job_title}}Company size: {{company_size}}Industry: {{company_industry}}Message: {{lead_message}}Source page: {{lead_source}}The prompt returns a JSON object. An n8n JSON Parse node extracts score, tier, score_reason, and recommended_action as individual variables for use in subsequent steps.
When a lead qualification workflow crosses into AI agent territory — for example, when the workflow needs to make outbound contact autonomously rather than just notifying a human — the architecture changes significantly. For most SMBs, the notify-a-human approach in this workflow is the correct starting point.
The scoring criteria table below shows how points accumulate for a typical strong lead versus a weak one:
| Scoring Criterion | Strong Lead Example | Weak Lead Example | Points |
|---|---|---|---|
| Problem specificity | “We process 400 invoices monthly, all manual” | “Interested in AI automation” | +3 vs 0 |
| Urgency language | “Currently evaluating solutions” | No urgency signals | +2 vs 0 |
| Fit signal | Invoice processing, recruitment workflow | Wanting a mobile app | +2 vs -2 |
| Company size | 45-person professional services firm | 2-person startup | +1 vs 0 |
| Job seniority | Operations Director | Unspecified | +1 vs 0 |
| Budget awareness | “Have budget approved” | No mention | +1 vs 0 |
| Total | 10 vs -2 |
Step 4: Update Your CRM and Send the Slack Alert
With the enrichment data and AI score available, the CRM update step writes everything to the lead record in a single API call.
For HubSpot, an HTTP Request node makes a PATCH call to the Contacts API. The request body maps the n8n variables to HubSpot custom properties. Create four custom properties in HubSpot before this step: ai_lead_score (number), ai_lead_tier (single-line text), ai_score_reason (multi-line text), and ai_recommended_action (single-line text).
{ "properties": { "ai_lead_score": "{{score}}", "ai_lead_tier": "{{tier}}", "ai_score_reason": "{{score_reason}}", "ai_recommended_action": "{{recommended_action}}", "company": "{{lead_company}}", "jobtitle": "{{contact_job_title}}", "numemployees": "{{company_size}}" }}An IF node after the CRM update branches the workflow based on tier. Hot and warm leads proceed to the Slack notification. Cold leads route to a separate branch that enrolls them in a HubSpot nurture sequence via the Workflows API and ends without a Slack alert.
Why this workflow outgrows Zapier at the CRM integration stage is specifically the conditional branching after scoring — Zapier’s path logic cannot handle the three-way conditional (hot/warm/cold) with different downstream actions for each without significant workarounds that add cost and fragility.
The Slack notification uses a Slack node posting to your designated sales channel. Format the message with enough context that the recipient can act immediately:
*New {{tier}} lead — score {{score}}/10*Name: {{lead_name}}Company: {{lead_company}} ({{company_size}} employees, {{company_industry}})Title: {{contact_job_title}}Message: {{lead_message}}Score reason: {{score_reason}}Recommended action: {{recommended_action}}HubSpot: [link to contact record]Hot leads can optionally trigger an additional notification via SMS using an n8n Twilio node, ensuring the alert reaches someone even if Slack is not actively monitored.
The Complete n8n Workflow JSON
Import the JSON below into n8n via Settings > Import Workflow. Update the webhook URL, API credentials, and CRM field names to match your stack before testing.
{ "name": "AI Lead Qualification Workflow", "nodes": [ { "parameters": { "httpMethod": "POST", "path": "lead-qualification", "responseMode": "onReceived" }, "name": "Webhook", "type": "n8n-nodes-base.webhook", "typeVersion": 1, "position": [240, 300] }, { "parameters": { "values": { "string": [ { "name": "lead_name", "value": "={{$json[\"name\"]}}" }, { "name": "lead_email", "value": "={{$json[\"email\"]}}" }, { "name": "lead_company", "value": "={{$json[\"company\"]}}" }, { "name": "lead_message", "value": "={{$json[\"message\"]}}" }, { "name": "lead_source", "value": "={{$json[\"source\"]}}" } ] } }, "name": "Parse Form Fields", "type": "n8n-nodes-base.set", "typeVersion": 1, "position": [460, 300] }, { "parameters": { "url": "https://api.apollo.io/v1/people/match", "authentication": "genericCredentialType", "genericAuthType": "httpHeaderAuth", "sendBody": true, "bodyParameters": { "parameters": [ { "name": "email", "value": "={{$json[\"lead_email\"]}}" } ] } }, "name": "Enrich via Apollo", "type": "n8n-nodes-base.httpRequest", "typeVersion": 3, "position": [680, 300] }, { "parameters": { "resource": "text", "operation": "message", "model": "gpt-4o", "messages": { "values": [ { "role": "system", "content": "You are a lead qualification specialist. Score leads 1-10 and return only valid JSON with fields: score, tier, score_reason, recommended_action. Tier is hot (8-10), warm (5-7), cold (1-4)." }, { "role": "user", "content": "=Lead: {{$json[\"lead_name\"]}}\nCompany: {{$json[\"lead_company\"]}}\nTitle: {{$json[\"contact_job_title\"]}}\nSize: {{$json[\"company_size\"]}}\nMessage: {{$json[\"lead_message\"]}}" } ] } }, "name": "AI Score Lead", "type": "@n8n/n8n-nodes-langchain.openAi", "typeVersion": 1, "position": [900, 300] }, { "parameters": { "dataPropertyName": "message.content" }, "name": "Parse Score JSON", "type": "n8n-nodes-base.jsonParse", "typeVersion": 1, "position": [1120, 300] }, { "parameters": { "url": "=https://api.hubapi.com/crm/v3/objects/contacts/{{$json[\"contact_id\"]}}", "authentication": "genericCredentialType", "genericAuthType": "httpHeaderAuth", "requestMethod": "PATCH", "sendBody": true, "bodyParameters": { "parameters": [ { "name": "properties", "value": "={\"ai_lead_score\": \"{{$json.score}}\", \"ai_lead_tier\": \"{{$json.tier}}\", \"ai_score_reason\": \"{{$json.score_reason}}\"}" } ] } }, "name": "Update HubSpot", "type": "n8n-nodes-base.httpRequest", "typeVersion": 3, "position": [1340, 300] }, { "parameters": { "conditions": { "string": [ { "value1": "={{$json[\"tier\"]}}", "operation": "notEqual", "value2": "cold" } ] } }, "name": "Hot or Warm?", "type": "n8n-nodes-base.if", "typeVersion": 1, "position": [1560, 300] }, { "parameters": { "channel": "sales-leads", "text": "=*New {{$json[\"tier\"]}} lead — score {{$json[\"score\"]}}/10*\nName: {{$json[\"lead_name\"]}}\nCompany: {{$json[\"lead_company\"]}}\nMessage: {{$json[\"lead_message\"]}}\nReason: {{$json[\"score_reason\"]}}\nAction: {{$json[\"recommended_action\"]}}" }, "name": "Slack Alert", "type": "n8n-nodes-base.slack", "typeVersion": 2, "position": [1780, 200] } ], "connections": { "Webhook": { "main": [[{ "node": "Parse Form Fields", "type": "main", "index": 0 }]] }, "Parse Form Fields": { "main": [[{ "node": "Enrich via Apollo", "type": "main", "index": 0 }]] }, "Enrich via Apollo": { "main": [[{ "node": "AI Score Lead", "type": "main", "index": 0 }]] }, "AI Score Lead": { "main": [[{ "node": "Parse Score JSON", "type": "main", "index": 0 }]] }, "Parse Score JSON": { "main": [[{ "node": "Update HubSpot", "type": "main", "index": 0 }]] }, "Update HubSpot": { "main": [[{ "node": "Hot or Warm?", "type": "main", "index": 0 }]] }, "Hot or Warm?": { "main": [ [{ "node": "Slack Alert", "type": "main", "index": 0 }], [] ] } }}Before going live, test with five real form submissions covering the range of lead quality you expect. Check that the AI scores align with your own assessment of each lead. If they do not, adjust the scoring criteria weights in the system prompt until the calibration feels right for your specific client profile.
Any form tool that supports webhook submissions on form completion works with this workflow. Typeform, Tally, Jotform, and native HubSpot forms all support outbound webhooks. For HubSpot forms, use HubSpot’s native workflow trigger rather than a separate webhook to avoid duplication. Google Forms requires a third-party connector such as Zapier or a Google Apps Script to forward submissions to the n8n webhook.
Add a Try/Catch node wrapping the Parse Score JSON step. If parsing fails, the catch branch sets default values — score of 5, tier of warm, score reason of “Parsing error — manual review required” — and continues the workflow rather than failing silently. Also add response format enforcement to the OpenAI API call using the `response_format: { type: “json_object” }` parameter, which significantly reduces malformed responses from GPT-4o.
Apollo.io’s free tier covers 50 enrichment requests per month. Their basic plan at approximately $49 per month covers 1,200 per month. Clearbit’s pricing is higher but the data quality is better for UK and European companies. At 200 form submissions per month, enrichment costs are £30 to £80 per month depending on provider and plan. The enrichment step is optional — the scoring prompt works without it, just with lower firmographic signal quality.
Yes. Add a Router node after the Webhook step that branches based on the `lead_source` field or a hidden form field identifying the campaign. Each branch feeds its own scoring prompt with criteria calibrated to that form’s context — a pricing page enquiry has different qualification signals to a content download. The CRM update and Slack notification steps can be shared across branches or customised per branch depending on whether routing differs by source.
Using a third-party API to enrich personal data (email address, LinkedIn profile) requires a lawful basis under UK GDPR. For B2B lead qualification, legitimate interests is the most commonly used basis — the enrichment is necessary to evaluate whether to enter a commercial relationship, and the privacy impact on the individual is low. Document your legitimate interests assessment, include enrichment disclosure in your privacy policy, and ensure your enrichment provider’s data processing agreement covers UK GDPR requirements. Apollo.io and Clearbit both publish DPAs. Do not use personal email addresses for enrichment without additional consideration — enrichment APIs are designed for business contacts.
Start with the thresholds in the prompt above — 8 to 10 for hot, 5 to 7 for warm, 1 to 4 for cold — and review the first 50 scored leads manually. Compare the AI scores to your own assessment. If hot leads at score 8 are still regularly not converting, raise the hot threshold to 9. If too few leads are reaching hot, lower it to 7. The correct threshold depends entirely on your conversion rate expectations and the ratio of lead volume to sales capacity. There is no universal right answer — calibrate to your pipeline.