DEV Community

T.M. Gunderson
T.M. Gunderson

Posted on

I Built an AI Agent That Qualifies Leads While I Sleep (And Booked 3 Calls This Week)

I Built an AI Agent That Qualifies Leads While I Sleep (And Booked 3 Calls This Week)

Here's a number that still bugs me: 78% of customers buy from the company that responds first (Harvard Business Review). Not the best company. Not the cheapest. The fastest.

When I was running a 4-person shop, our average first-response time to a new lead was 14 hours. Not because we didn't care — because we were busy doing billable work. Every lead that came in after 5 PM sat until the next morning. Every weekend lead sat until Monday.

That delay cost us real money. I tracked it for a month: 11 leads went cold before we responded. At our average deal size, that was roughly $18,000 in lost pipeline.

So I built an n8n workflow that qualifies leads automatically. It watches incoming emails and form submissions, scores each lead based on criteria I set, sends a personalized reply within 2 minutes, and books a call with qualified leads directly on my calendar.

The result: 3 extra qualified calls booked this week alone, and I never touched the initial outreach.

Here's the full build.

Why Lead Response Speed Is Everything

Most small businesses handle leads the same way:

  1. Lead fills out a contact form or sends an email
  2. Notification lands in someone's inbox
  3. Someone checks inbox when they have time
  4. They craft a response
  5. They follow up 2 days later after the lead has already hired someone else

The gap between step 1 and step 4 is where deals die. A Drift study found that the odds of qualifying a lead drop 400% if you wait more than 5 minutes to respond. Not exaggerating. 400%.

The math is brutal:

  • Respond within 1 minute → 391% conversion improvement (MIT study)
  • Respond within 5 minutes → still strong
  • Respond within 30 minutes → significant drop-off
  • Respond within 24 hours → you're competing on price, not speed

You don't need to close the deal in 5 minutes. You need to start the conversation in 5 minutes. The closing still takes relationship-building. But you can't build a relationship with someone who already hired your competitor.

The Lead Scoring Framework

Before automating anything, define what makes a lead worth pursuing. I use a simple 4-factor score:

Factor Weight What I Check
Company fit 30% Do they match my ideal customer profile?
Budget signal 25% Did they mention a budget or project scope?
Timeline urgency 25% Do they need something done soon?
Engagement depth 20% How much detail did they provide in their inquiry?

Each factor scores 0–5. A lead that hits 12+ out of 20 is "hot." 8–11 is "warm." Below 8 gets a polite nurture sequence instead of a call booking.

This is critical: not every lead deserves a call. Qualifying out bad leads is as valuable as qualifying in good ones. A 15-minute call with someone who can't afford your services is 15 minutes you'll never get back.

The n8n Workflow: Lead Qualification Agent

The workflow has 6 stages: Collect → Score → Reply → Book → Log → Nurture.

Stage 1: Collect Incoming Leads

Use two trigger nodes feeding into the same pipeline:

Webhook Trigger — for contact form submissions (Calendly, Typeform, Tally, or any form that supports webhooks):

Webhook Trigger (POST /new-lead)
    → Set Node: Normalize form fields into standard schema
Enter fullscreen mode Exit fullscreen mode

Gmail Trigger — for inbound lead emails:

Gmail Trigger (new email from unknown sender)
    → IF Node: Is this a lead inquiry? (check for keywords like "quote", "project", "help with", "looking for")
    → True: continue to scoring
    → False: archive / skip
Enter fullscreen mode Exit fullscreen mode

Standardize the data into a common schema regardless of source:

Field Example Source
name "Jordan Rivera" Form field or email parsing
email jordan@riveralandscaping.com Form field or sender
company Rivera Landscaping Form field or email signature
message "Need help automating..." Form field or email body
source "contact-form" / "email" Which trigger caught it
received_at 2026-06-29T22:15:00Z Timestamp

Stage 2: Score the Lead

Use an OpenAI node with structured output:

System prompt:

You are a lead qualification agent for a small business automation consultancy. Score each lead on these factors:

1. company_fit (0-5): Does this company match our ideal customer profile? Our ICP: 5-50 employees, service-based business, currently using manual processes for client communication, invoicing, or project management.

2. budget_signal (0-5): Did they mention a budget, project scope, or pricing expectation? Even vague signals ("looking for something affordable") count.

3. timeline_urgency (0-5): Do they need work done soon? "ASAP" or "this quarter" scores higher than "exploring options."

4. engagement_depth (0-5): How much detail did they provide? A one-liner scores low. A detailed description of their problem scores high.

Return ONLY valid JSON: { "company_fit": N, "budget_signal": N, "timeline_urgency": N, "engagement_depth": N, "total_score": N, "tier": "hot"|"warm"|"cold", "reasoning": "one sentence explaining the score" }
Enter fullscreen mode Exit fullscreen mode

Stage 3: Personalized Auto-Reply

Based on the tier, send a different response:

Hot lead (12+): Send within 2 minutes with a Calendly link:

Hi {{ name }},

Thanks for reaching out about {{ topic }}. Sounds like exactly what we help with.

I've got availability this week — would any of these times work for a quick 20-minute call?

[Calendly Link]

Talk soon,
[Your Name]
Enter fullscreen mode Exit fullscreen mode

Warm lead (8-11): Send a value-first response, ask a qualifying question:

Hi {{ name }},

Thanks for your message. {{ topic }} is something we work on a lot.

A quick question to make sure we're a good fit: [qualifying question based on their inquiry]

Best,
[Your Name]
Enter fullscreen mode Exit fullscreen mode

Cold lead (<8): Add to a nurture sequence. Don't waste a call slot.

Stage 4: Book the Call

For hot leads, the Calendly link is already in the email. But add a safety net:

IF Node: "tier" = "hot"
    → Google Calendar: Check next 3 available slots
    → If no slots this week → Send alternate message: "My calendar is tight this week, but I want to make sure we connect. Can you share 2-3 times that work for you?"
Enter fullscreen mode Exit fullscreen mode

After the call is booked (via Calendly webhook), log it:

Calendly Webhook (event created)
    → Google Sheets: Log the call date, lead info, score
    → Slack: Notify #leads channel
Enter fullscreen mode Exit fullscreen mode

Stage 5: Log Everything

Every lead — hot, warm, or cold — gets logged in a Google Sheet:

Date Name Company Email Score Tier Source Action Taken Next Step
2026-06-29 Jordan Rivera Rivera Landscaping jordan@... 14 hot contact-form Call booked 7/1 Call on Tue
2026-06-29 Alex Chen Chen Design alex@... 9 warm email Qualifying Q sent Awaiting reply

This sheet becomes your CRM. No HubSpot needed.

Stage 6: Nurture the Colds

For cold leads, enroll them in a 3-email sequence:

Day Subject Content
1 Thanks for reaching out Polite acknowledgment + 1 relevant resource
4 Thought you'd find this useful Case study or how-to guide related to their inquiry
11 Still exploring automation? Light check-in with an easy question

Use n8n's Wait node between emails:

Send Email 1
    → Wait 3 days
    → Send Email 2
    → Wait 7 days
    → Send Email 3
    → Update Sheet: "Nurture complete"
Enter fullscreen mode Exit fullscreen mode

The Full Workflow Diagram

Webhook Trigger (form submissions) ──┐
                                       ├──→ Normalize Data
Gmail Trigger (lead emails) ───────────┘
    ↓
AI Score Lead (OpenAI structured output)
    ↓
Switch on Tier:
    ↓ Hot (12+)            ↓ Warm (8-11)       ↓ Cold (<8)
    ↓                      ↓                    ↓
Personalized reply        Qualifying Q         Nurture Email 1
+ Calendly link           + value content       + resource link
    ↓                      ↓                    ↓
Log to Sheet              Log to Sheet          Wait 3 days
    ↓                      ↓                    ↓
Slack #leads alert        Wait for reply        Nurture Email 2
                                                  ↓
                                               Wait 7 days
                                                  ↓
                                              Nurture Email 3
                                                  ↓
                                              Log to Sheet
Enter fullscreen mode Exit fullscreen mode

The Results: First 30 Days

I ran this for 30 days alongside manual outreach to compare:

Metric Manual (Previous Month) Automated (This Month)
Avg response time 14 hours 2 minutes
Leads responded to same day 60% 100%
Calls booked 6 9
Calls showed up 4 (67%) 7 (78%)
Deals closed 2 3
Pipeline value ~$12,000 ~$19,500

The response time alone shifted everything. Leads who got a fast reply were more engaged on the call. They showed up more often. They closed faster.

The nurture sequence also pulled 2 warm leads into calls over the month — people who wouldn't have gotten a second touch otherwise.

3 Things That Trip People Up

1. The AI will occasionally mis-score a lead.
Accept it. At ~5% mis-score rate, you'll occasionally send a "hot" reply to someone who isn't ready. That's fine — it's a 2-minute email, not a marriage proposal. And you'll catch more true hot leads than you'd ever catch manually at 14-hour response times.

2. You need a human in the loop for the call.
Automation books the call. You still show up and close. This workflow doesn't replace the sale — it replaces the delay before the sale.

3. Your scoring criteria must match YOUR business.
My 4-factor framework works for B2B service businesses. If you sell B2C, weight timeline and engagement more. If you sell enterprise, weight company fit more. Tune the weights based on who actually closes.

The Setup Checklist

  1. ✅ Define your lead scoring criteria (copy the 4-factor framework and adjust weights)
  2. ✅ Create a Google Sheet with the columns above
  3. ✅ Set up a Calendly or similar booking link
  4. ✅ Build the Webhook + Gmail triggers in n8n
  5. ✅ Add the AI scoring node with your custom system prompt
  6. ✅ Write 3 reply templates (hot, warm, cold)
  7. ✅ Test with 5-10 real past leads to calibrate the scoring
  8. ✅ Go live and monitor the Sheet for 2 weeks

Setup time: 60–90 minutes. Time saved per week: 3–5 hours on lead follow-up alone. Deals closed: more.


If you want the importable n8n workflow JSON + the scoring prompt + the reply templates, grab the **AI Agent Starter Kit* at smbscaleup.gumroad.com. It includes this workflow and 9 others, all ready to import.*

What's your current lead response time? Drop a comment — I'm curious how many of you are under 5 minutes.

Top comments (0)