Production-tested automation

AI Lead Management & Qualification Automation

Built by Ilham Lodin

An end-to-end lead processing system that captures inquiries, validates and deduplicates them, uses Google Gemini to qualify the lead, stores structured results, and sends an immediate personalized HTML response.

n8nGoogle GeminiGoogle SheetsGmailWebhooks
7-stageAutomated lead pipeline
AI-qualifiedPriority, type, summary & action
Auto-responsePersonalized HTML email
The problem

Turn raw inquiries into actionable leads.

Before automation

Incoming inquiries can require manual checking, qualification, data entry, and follow-up. That creates repetitive work and increases the chance of slow responses.

After automation

One incoming lead triggers a complete processing chain — from validation and duplicate protection to AI analysis, database storage, and customer response.

Architecture

How the system works

The workflow is orchestrated in n8n, with Gemini providing structured lead qualification and Google services handling storage and communication.

Lead automation workflow architecture
Capabilities

Built for real lead operations.

Webhook intake

Accepts structured lead data from a production webhook endpoint.

🛡️

Validation & deduplication

Normalizes input, rejects invalid submissions, and prevents duplicate lead records.

Gemini qualification

Generates priority, lead type, summary, and recommended action using structured AI output.

📊

Lead database

Appends structured lead records to Google Sheets for simple team visibility.

✉️

HTML response

Sends a personalized follow-up email automatically through Gmail.

🚨

Error handling

Includes an error-alert path with workflow and execution details for troubleshooting.

Proof of execution

Not a mockup. A tested workflow.

The following evidence was captured from the working automation. Personal test contact information has been anonymized for portfolio use.

Sanitized Google Sheets lead database proof
01 · Google Sheets output
Lead details and AI-generated qualification fields are automatically written into the lead database.
Sanitized Gmail automated response proof
02 · Automated Gmail response
The workflow generates a personalized HTML email using the lead's data and AI qualification.

Example AI output

For a lead requesting an AI chatbot:

{ "name": "Demo Client", "service_requested": "AI Automation", "lead_priority": "High", "lead_type": "Hot", "summary": "Interested in implementing an AI chatbot for business operations.", "recommended_action": "Schedule a discovery call." }

The structured output is then mapped into the spreadsheet and used to personalize the email response.

Business value

Less manual work. Faster follow-up.

For sales teams

  • See qualified leads in one place
  • Prioritize high-value inquiries
  • Get recommended next actions
  • Reduce repetitive data entry

For customers

  • Immediate acknowledgement
  • Personalized response
  • Consistent messaging
  • No waiting for manual processing
Technical summary

What this project demonstrates

Practical experience designing and testing an automation that connects webhooks, conditional logic, duplicate detection, an AI model, structured output parsing, Google Sheets, Gmail, and an error-handling path inside n8n.

Workflow designAPI/webhook handlingAI integrationStructured dataEmail automationError handling