What Was the Problem?
The client — a B2B SaaS company — was losing leads because their sales team manually reviewed every form submission. This took 2–4 hours per lead, and by the time someone followed up, the prospect had already moved on.
They needed a system that could:
- Automatically capture new leads from multiple sources
- Score and qualify them based on company size, budget, and intent
- Route hot leads to sales instantly
- Send a personalized follow-up email within 60 seconds
What I Built
Using n8n, I designed a multi-step automation workflow that runs 24/7 without human intervention.
Workflow Overview
- Trigger — Webhook fires when a lead submits the contact form (or comes in via LinkedIn or Ads)
- Enrichment — Pulls company data from Clearbit/Apollo to get company size, industry, and revenue
- AI Scoring — Sends enriched lead data to GPT-4o with a custom prompt that scores the lead (Hot / Warm / Cold) and writes a personalized outreach email
- CRM Entry — Creates/updates the contact in HubSpot with all enriched data and AI score tags
- Routing — Hot leads trigger an instant Slack alert to the sales team with full context
- Email — Personalized first-touch email is sent from the client's Gmail within 60 seconds of form submission
- Logging — Everything is logged to a Google Sheet for tracking and reporting
Key Technical Details
- Used n8n's AI Agent node with a structured JSON output schema so GPT-4o returns scores in a predictable format
- Built error handling and fallback paths — if Clearbit fails, it falls back to form data only
- The Slack message includes a direct link to the HubSpot contact so sales reps can act immediately
- Email templates are dynamically generated — GPT-4o writes a different opening line based on the lead's industry
Results
🏆 Lead response time: 3 hours → under 60 seconds
📈 Lead qualification accuracy: improved by 70% vs. manual review
⏱️ Time saved: Sales team saves 12–15 hours/week of manual review
💰 ROI: Workflow paid for itself within the first month
Tools Used
- n8n — Workflow orchestration
- GPT-4o (OpenAI) — Lead scoring & email generation
- HubSpot API — CRM integration
- Clearbit API — Lead enrichment
- Gmail SMTP — Email delivery
- Slack Webhooks — Real-time sales alerts
- Google Sheets — Logging and reporting