How to Build a Lead Qualification Bot with Claude AI and n8n in 4 Hours

How to Build a Lead Qualification Bot with Claude AI and n8n in 4 Hours, Atech360 Insights cover

How to Build a Lead Qualification Bot with Claude AI and n8n in 4 Hours

A complete walkthrough, from webhook setup to CRM update, with real configuration and the Claude API prompt that actually works.

Most businesses lose qualified leads not because they lack interest, they lose them because no one followed up fast enough. Research shows 78% of customers buy from the first company to respond. With this n8n + Claude AI setup, your first follow-up happens in under 90 seconds, 24 hours a day.

What You’ll Build

By the end of this guide, you’ll have a working lead qualification bot that:

  • Receives new leads from any form (Gravity Forms, Typeform, Webflow, etc.)
  • Uses Claude AI to score the lead and assess budget, timeline, and fit
  • Sends a personalized follow-up email within 60–90 seconds of form submission
  • Logs the scored lead to your CRM (Zoho, HubSpot, or Airtable)
  • Notifies your sales rep via Slack or email only for high-score leads
90s
Response time
3×
More qualified appts
8hrs
Saved weekly
0
Missed leads

What You Need

  • n8n, self-hosted or n8n.cloud (free tier works for this)
  • Anthropic API key, from console.anthropic.com (~$0.01 per qualification)
  • A CRM, Zoho, HubSpot, or Airtable (all have n8n nodes)
  • An email account, Gmail or SMTP for follow-up

Step 1: Create the n8n Webhook Trigger

In n8n, create a new workflow. Add a Webhook node as the trigger. Set Method to POST, and copy the webhook URL. This is the URL you’ll put in your web form’s submission endpoint.

Test it by submitting a dummy form entry, you should see the payload appear in n8n’s execution log.

Step 2: Format the Lead Data

Add an Edit Fields node (formerly Set node) to extract the relevant fields from your form payload:

name:     {{ $json.body.name }}
email:    {{ $json.body.email }}
company:  {{ $json.body.company }}
message:  {{ $json.body.message }}
budget:   {{ $json.body.budget }}

Step 3: The Claude AI Qualification Call

Add an HTTP Request node pointed at https://api.anthropic.com/v1/messages. Use POST method with these headers:

x-api-key: YOUR_ANTHROPIC_API_KEY
anthropic-version: 2023-06-01
Content-Type: application/json

Body (JSON):

{
  "model": "claude-haiku-4-5",
  "max_tokens": 400,
  "messages": [{
    "role": "user",
    "content": "You are a lead qualification specialist. Analyze this lead and respond with JSON only.\n\nLead details:\n- Name: {{ $json.name }}\n- Company: {{ $json.company }}\n- Message: {{ $json.message }}\n- Budget: {{ $json.budget }}\n\nRespond with:\n{\n  \"score\": 1-10,\n  \"intent\": \"high|medium|low\",\n  \"summary\": \"2 sentence assessment\",\n  \"recommended_action\": \"specific next step\"\n}"
  }]
}
💡 Use claude-haiku-4-5 for speed and cost. At ~$0.003 per 1k tokens, qualifying 1,000 leads costs under $3. The response is usually under 150 tokens.

Step 4: Parse the Claude Response

Add a Code node to extract the JSON from Claude’s response:

const response = $input.first().json;
const content = response.content[0].text;
const parsed = JSON.parse(content);
return { json: parsed };

Step 5: Route Based on Score

Add an IF node: if score >= 7, go to the high-value branch. If score < 7, go to the nurture branch.

High-value branch: Send personalized email + Slack notification to sales rep + add to CRM as Hot Lead.

Nurture branch: Add to email drip sequence, log to CRM as Prospect.

Step 6: The Personalized Follow-Up Email

Your email should reference what the lead actually wrote, not a generic template. Use the summary and recommended_action from Claude's response to personalize each email automatically:

Subject: Quick thought on what you shared, {{ $json.name }}

Hi {{ $json.name }},

Thanks for reaching out. Based on what you shared about
{{ $json.company }}, here's what we're thinking...

{{ $json.summary }}

{{ $json.recommended_action }}

Want to jump on a quick 20-minute call this week?

[Book a Time →]

Results From Real Deployments

We've deployed this exact setup for law firms, real estate agencies, SaaS companies, and e-commerce brands. The numbers are consistent:

78%
Leads respond to personalized follow-up
3.2×
Higher appointment rate vs generic email
<2min
Average time from form submit to reply
$0.01
Cost per lead qualification

Common Issues & Fixes

  • Claude returns invalid JSON: Add explicit instruction in the prompt: 'Return ONLY the JSON object, no other text'
  • Webhook not receiving data: Check your form is sending to the correct URL and using POST method
  • Email looks like spam: Ensure your email domain has SPF/DKIM records set up

Want This Built for Your Business?

Get a free AI assessment, tell us about your project and Nnta will generate a tailored strategy and quote in under 2 minutes.

Get Your Free Quote →