A fully automated workflow that captures website leads, validates requests, scores them with Gemini AI, creates CRM pipeline deals, and prepares personalized follow-up drafts — all without manual intervention.
Businesses often receive leads from multiple sources — websites, social media, referrals — but struggle with slow follow-ups, inconsistent qualification, duplicate submissions, and unclear lead priority. Without a structured process, high-value leads get lost, teams waste time on low-intent contacts, and there's no clear system for deciding who to follow up with first.
I built an automated lead qualification workflow that handles everything from initial capture to CRM entry:
Receives leads from a secure webhook endpoint
Validates each request using a shared-secret header
Normalizes lead data into a consistent schema regardless of source
Checks for duplicate submissions via Supabase before processing
Stores raw webhook events and normalized leads with full metadata
Uses Gemini API to analyze lead quality, intent, and pain points
Calculates a composite lead score across multiple weighted dimensions
Creates a deal record in the CRM pipeline automatically
Prepares a personalized follow-up email draft ready for human approval
Logs the full automation lifecycle end-to-end for traceability
Each step is an isolated n8n node. If any stage fails — duplicate detected, invalid secret, Gemini timeout — the pipeline halts cleanly and logs the failure without affecting other leads.
The full pipeline runs in under three seconds from webhook trigger to CRM entry, Slack alert, and approval request.
Submit a sample lead and see the AI qualification result. No external API calls are made — this uses static pre-generated output.
We get Facebook leads but our team keeps missing follow-ups. We need a website and automation system that helps us respond faster.
For security and cost control, this public demo uses sample AI output. A live backend walkthrough is available upon request.
Request headers are verified with a shared secret before any processing begins.
Incoming data from any source is standardized to a consistent internal schema.
Email-based lookup in Supabase prevents re-processing the same lead twice.
AI analyzes lead messages and context to determine intent and overall quality.
Budget, urgency, service fit, and message quality scored as separate dimensions.
Raw webhook events and normalized leads stored with timestamps and metadata.
Deal records are created automatically with AI-enriched lead data attached.
AI writes a personalized draft ready for human review before sending.
Every step of the automation lifecycle is logged for debugging and auditing.
The backend is built entirely inside n8n, using a combination of webhook nodes, HTTP nodes, code nodes, and Supabase integrations. Here's how each stage works:
n8n receives an HTTP POST to a secure endpoint. A shared-secret header is validated before any action is taken.
A Supabase lookup verifies the submitted email does not already exist in the leads table. Duplicate submissions are rejected early.
The raw payload is saved to a webhook_events table before any transformation, preserving the original data for auditing.
The lead message, service type, and urgency are sent to Gemini with a structured prompt. The model returns a JSON object with pain points, risk level, and recommendations.
A code node parses the AI response and computes a composite score using budget, urgency, service fit, message quality, location, and AI confidence.
A normalized deal record is written to the crm_deals table in Supabase, including the AI score, category, and enrichment data.
An approval request is created in n8n containing the AI-generated follow-up email. A team member reviews and sends — or discards — the draft.
The system does not automatically send important sales replies.
Instead, it creates an approval request so a human can review, edit, approve, or reject the AI-generated draft before anything is sent. The AI handles research, scoring, and writing — but a real person makes the final call on every outbound message.
Analyzes the lead, scores it, and writes a personalized follow-up draft
Creates an approval request containing the draft, lead score, and AI summary
Reviews the draft — edits the tone, adjusts the copy, or rejects it entirely
Approves — the email is sent. Or rejects — the draft is discarded with no action taken
Logs the approval decision and outcome to the automation audit trail
This workflow can be connected to GoHighLevel through webhooks or API-based contact and deal creation. Instead of storing deals only in Supabase, the same lead score, AI summary, and follow-up recommendation can be pushed directly into a GoHighLevel pipeline — creating contacts, tagging leads by tier, and triggering GHL automations based on the AI score. Internal notifications can also be sent to Slack whenever a hot or warm lead is detected, so your team knows immediately without checking a dashboard.

Leads arrived from different sources in inconsistent formats
Every lead is normalized to a consistent schema regardless of source
No duplicate check — the same contact could enter the pipeline multiple times
Duplicate submissions are caught at intake before any processing happens
Qualification was manual, slow, and inconsistent across team members
AI scores each lead across budget, urgency, fit, and message quality within seconds
High-value leads had no priority signal — they sat in the same inbox as low-intent submissions
High-score leads are flagged immediately with a numeric tier and recommended next action
Follow-up depended entirely on someone remembering to act
A personalized follow-up draft is generated and queued for human approval automatically
No audit trail — if a lead was missed, there was no record of why
Every step of the automation lifecycle is logged and fully auditable end-to-end
I build custom automation workflows tailored to your lead sources, CRM, and follow-up process. Get in touch for a free discovery call.