Blog · · 5 min read
How to qualify leads with n8n and AI (form + email → Google Sheets + alert)
Build a lead qualifier with n8n: website form or Gmail, AI scoring against your ideal customer, a Google Sheets row, and an alert email only when the score clears the threshold.

If you sell services to businesses or freelancers, you know the problem: the website form and your Gmail inbox fill up with requests. Some are gold («we have three shops, £3,000 budget, want to start now»). Others are noise («we sell cheap SEO» or a bot that fills every field). If you review every one by hand, you waste hours. If you don't, the good ones slip away.
With n8n (visual automation), a bit of AI and Google Sheets you can build a filter: each contact is scored against your ideal customer, saved to a sheet, and you only get alerted on the ones worth a call.
What you'll build
For every lead, the workflow:
- Collects the contact from a webhook (website form) and/or from emails arriving in Gmail (quotes, «contact us»).
- Normalises the data (name, email, company, phone, budget, message) so the source doesn't matter.
- The AI scores 0–100 against your ideal-customer definition and labels them hot, warm, cold or spam, with the reason and a recommended next step.
- Writes a row to Google Sheets with score, category and summary.
- If they clear the threshold (70 by default), it sends you an alert email with the summary and contact details.
The AI doesn't «guess» the lead: it only sees what they wrote. You set the criteria. That's what makes the workflow useful.
What you need
- An n8n instance with HTTPS.
- An OpenAI key (or another model compatible with the chat node).
- Google Sheets OAuth2 and Gmail OAuth2 credentials.
- A Google Sheet with a Leads tab and clear headers (date, source, name, email, company, phone, budget, score, category, reason, next step, summary, message).
- About 40 minutes and a concrete definition of who you do and don't want to sell to.
Step 1: define your ideal customer in one place
Before you touch nodes, put this in a settings node at the start of the flow:
- What you sell and to whom.
- Ideal customer: sector, size, area, minimum budget, urgency.
- Red flags: agencies asking to «partner», students, competitors, empty messages.
- Hot threshold (e.g. 70) and the email that should receive alerts.
- The Google Sheet ID (the bit of the URL between
/d/and/edit).
Be specific. «Companies that want to grow» doesn't help the AI. «Workshops or clinics with 2–10 staff in your country, budget from £500 and a clear start date» does.
Step 2: form (and optionally Gmail)
Create a Webhook node that accepts POST and copy the production URL. Your website form should send something like:
{"name":"Laura","email":"laura@company.com","company":"North Clinic","phone":"+44…","budget":"1500","message":"We want to automate bookings across 3 sites"}
Add a hidden honeypot field so bots fill it and you can discard them.
If you also want to score quote emails, connect a Gmail trigger with a tight search (e.g. subject contains «quote» or «contact», or only a specific mailbox). A code node unifies form and email into the same shape. Form only? You can drop the Gmail branch.
Step 3: the AI scores the lead
A chat node receives the lead's message plus your settings (IDEAL_CUSTOMER, red flags, what you sell). The prompt asks for a structured reply: score 0–100, category (hot / warm / cold / spam), a short reason and a next step (call today, send a proposal, archive…).
Typical weights in a prompt like this are ideal-customer fit, budget/urgency, message quality and spam signals. Tune them for your business; there is no universal formula.
Ask the AI to explain the reason. When you review the sheet, you'll see why an 82 isn't a 45, and you can tighten the prompt.
Step 4: save to Sheets and alert only on hot leads
The Google Sheets node appends a row with every field. It won't replace a CRM if you get hundreds of leads a day, but for a small business it's enough and you stay in control.
Then an IF: if the score is at or above the threshold, a Gmail node emails you the alert (name, email, phone, score, reason, next step and a short extract of the message). Warm and cold leads stay in the sheet for later review without interrupting you.
Test it with two contacts
- An ideal one: several sites, clear budget, urgency («start this month»). You should get a high score, hot category, a Sheets row and an alert email.
- A bad one: generic pitch, no budget, or obvious spam. It should land as cold or spam, with a row but no alert.
- Check that source (form / email) and the other columns fill correctly.
Honest limitations
- The score is a guide. The AI only sees what the lead wrote. A strong customer who writes poorly can score low; someone who pastes a «perfect» message can score high. Review the first 20–30 leads and refine
IDEAL_CUSTOMER. - The Gmail trigger usually polls about once a minute. The same email isn't processed twice, but changing the search can pick up recent messages from the last few days.
- Very long messages are worth truncating (to a few thousand characters) so you don't burn tokens or flood the prompt.
- It doesn't replace commercial judgement. It's a filter and a filing cabinet, not an autonomous salesperson.
- The webhook is public. The honeypot helps; if spam still arrives, add header auth or a captcha on the form.
Ideas to go further
- Auto-reply to hot leads («Thanks, we'll call you today») with a Gmail node after the IF.
- Replace or duplicate Sheets with HubSpot, Pipedrive or Notion (n8n has nodes for them).
- Link the form from your WhatsApp AI agent so people who ask about pricing get the form and arrive already scorable.
- Pair it with Google Calendar bookings when the next step is a demo or first meeting.
Shortcut: the agent already built
This workflow is one of the eight agents in the AgentKiosk pack: an n8n template ready to import, settings in one node, scoring prompt, sheet headers, alert email and a PDF guide. It has been imported and run end-to-end in n8n with sample data and simulated services; run your own tests with your sheet and Gmail before you use it with real customers.
To start for free, download the WhatsApp agent and also read 7 AI automations for small businesses.


