AI AUTOMATION

LeadOps AI CRM

AI-Powered Lead Qualification & Outreach Automation

WEBHOOKGEMINIAUTO REPLYCRM UPDATEFOLLOW-UPSCORE 0/100COMPLETE — <10s END-TO-ENDn8n + GEMINI — LEAD-TO-EMAIL <10sHIGH INTENTNURTURE TRACK
Response time
<10s
AI score range
1–10
Lead routing
Hot/Warm/Cold
Manual work
0

The Problem

Inbound leads decay by the minute — manual triage means slow first responses, inconsistent qualification, and forgotten follow-ups. The goal: respond to every lead in seconds, score it with AI, and keep the CRM current without a human in the loop for the routine work.

Architecture & System Design

  1. 01

    Ingestion layer: Google Forms captures lead data into Google Sheets; Apps Script onFormSubmit trigger dispatches the payload to an n8n webhook in real time.

  2. 02

    AI layer: Gemini API analyzes the lead profile, intent, budget signals, urgency, and fit — producing a numeric score (1–10) and personalized email copy instead of static templates.

  3. 03

    Delivery layer: Gmail SMTP sends the personalized outreach email to the prospect and, when the score crosses the hot-lead threshold, fires a priority alert to the sales inbox.

  4. 04

    Routing layer: n8n IF nodes branch on Hot / Warm / Cold classification — each tier gets a different follow-up sequence and CRM status.

  5. 05

    Storage layer: Google Sheets CRM stores structured lead data — score, category, AI analysis, email delivery status, and timestamp — as the auditable source of truth.

Engineering Decisions

Gemini for scoring and copy generation in one pass

A single Gemini call both scores the lead and drafts the personalized email, reducing latency and API calls. The prompt enforces structured output so downstream routing is deterministic.

Apps Script as the ingestion bridge

Using Google Apps Script onFormSubmit avoids polling and keeps the pipeline fully event-driven. The script normalizes the form payload and fires an HTTP POST to n8n, decoupling the ingestion layer from the automation engine.

Human-auditable by design

Every automated action logs its reasoning to the Google Sheets CRM record: score, category, AI analysis, and delivery status. Trust in automation comes from being able to see why the machine did what it did.

Tech Stack

n8nGoogle Gemini APIGoogle FormsGoogle Sheets APIGoogle Apps ScriptGmail SMTPWebhooksJavaScriptService Account CredentialsConditional Routing

Lessons Learned

  • Event-driven ingestion beats polling — Apps Script onFormSubmit fires immediately; a polling loop would add minutes of lag to a pipeline measured in seconds.
  • Structured AI output is non-negotiable in a real pipeline: forcing Gemini into a schema makes the score and routing deterministic, not probabilistic.
  • Workflow automation is distributed systems in disguise — idempotency and failure paths matter as much as the happy path.

Want the full system walkthrough?

Get in touch