🎣 Automate B2B lead generation & email campaigns with Google Maps, SendGrid & AI

142 views · 🎣 Lead Generation & Enrichment

💡 Pro Tip — HTTP Request scraping tends to break when sites update their markup. If you’re scraping a major platform, check if ScraperNode covers it — it has maintained scrapers for LinkedIn, Instagram, TikTok, YouTube, and 20+ other platforms that return structured data.

View All Scrapers

Description

📌 Overview

This n8n-powered workflow automates the entire lifecycle of lead generation and email workflows/campaign. It combines six specialized workflows into one seamless system that scrapes fresh leads, sends personalized emails, tracks engagements, detects replies, classifies responses, handles follow-ups, and keeps a live CRM updated — all in one loop. Designed for B2B cold outreach and follow-up nurturing, this system integrates with Apify, Google Sheets, SendGrid, Gmail, and OpenAI for AI summarization and real-time alerts.

🧠 What It Does

This workflow automates the entire lifecycle of B2B cold campaign. It:

💡 Why This Workflow

👤 Who It’s For

This workflow is ideal for:

⚙️ How It Works

🧩 1. Lead Generation Workflow

🎯 Purpose

Scrape fresh B2B leads from Google Maps, crawl their websites to extract verified email addresses, and upload structured, clean lead data into a Google Sheets CRM.

🛠 How It Works

1. User Input via Form Trigger

2. Scrape Google Maps via Apify

3. Website Filtering & Normalization

4. Website Email Extraction

5. Final Filtering & Data Structuring

6. Upload to Google Sheets CRM

🧩 2. Send an Email Workflow

🎯 Purpose

Automatically sends personalized emails to verified leads using rotating templates, embedded ID tracking, and campaign-stage tagging.

🛠 How It Works

1. Pull Active Leads from CRM

2. Select a Random Template

3. Embed Unique Tracking ID

4. Send Email via SendGrid

🧩 3. Webhook Event Workflow

🎯 Purpose

Processes SendGrid webhook events (e.g., delivered, opened, clicked, bounced) and updates the CRM with prioritized delivery status and engagement tracking — using clean classification and smart update logic.

🛠 How It Works

1. Receive Events via Webhook Trigger

2. Classify Each Event Type

3. Switch-Based Routing

4. CRM Synchronization

🧩 4. Reply Update Database Workflow

🎯 Purpose

Polls Gmail inbox, extracts replies, determines their source, and logs them in both the CRM and a message tracker sheet.

🛠 How It Works

1. Poll Gmail for New Replies

2. Prevent Duplicate Processing

3. Extract Reply Metadata 4. Match to Lead & Update CRM

🧩 5. Email Routing Workflow

🎯 Purpose

Uses AI to classify replies by intent (Interested, Not Interested, or Miscellaneous) and automatically routes, labels, and logs them accordingly.

🛠 How It Works

1. Receive Cleaned Reply

2. Classify Using AI (LangChain / OpenAI)

3. Gmail Label Assignment

4. Handle “Interested” Replies

🧩 6. Follow-Up Email Workflow

🎯 Purpose

Automatically sends up to two follow-up emails to leads who showed interest (opened or clicked) but haven’t replied yet.

🛠 How It Works

1. Scheduled Execution

2. Filter Leads for Follow-Up

3. Choose and Personalize Template

4. Send via SendGrid

5. Update CRM

✅ Setup Requirements (Before You Start)

Prepare these items to avoid interruptions during setup:

🛠 How to Set It Up

  1. Open n8n (Cloud or Self-Hosted).
  2. Install Apify node before importing.
    • Search Apify → click Install.
  3. Import the provided .json workflow file into your n8n editor.
  4. Set up the required credentials:
    • 🔑 Apify API Key,
    • 🔑 SendGrid API Key,
    • 🔑 Google Sheets OAuth,
    • 🔑 Gmail API,
    • 🔑 OpenAI API Key.
  5. Prepare your Google Sheet (CRM).
    • Verify column names match your workflow fields.
    • Adjust “Get Desired Fields” node in n8n “Lead generation workflow” if you add/remove columns.
  6. Enable SendGrid Webhook Events.
    • Go to SendGridSettingsMail SettingsEvent Webhook.
    • Paste the webhook URL from your n8n “Webhook Event Workflow”.
    • Select: Delivered, Opened, Clicked, Bounced, Unsubscribed, Spam Report.
  7. Run a test.
    • Trigger the Lead Generation workflow → check Google Sheets for leads.
    • Send a test email → verify delivery + engagement updates in CRM.
    • Reply from a test inbox → confirm Gmail polling + AI classification.

📂 Additional Provided Resources.

To help you get started faster, you’ll also receive:

🎨 Customization Tips

✨ Predefined Templates vs. AI-Generated Emails

By default, this workflow uses predefined templates stored in Google Sheets. This design choice was intentional, and here’s why:

⚡ That said, you can absolutely swap out the template system for AI-based generation if you prefer dynamic messaging. The workflow is flexible — just keep in mind the trade-offs in cost, reliability, and control. ⚡ Best approach: start with templates for stability, then add AI if you want more variety.

🔗 Nodes Used

Google Sheets, HTTP Request, Webhook, Gmail, SendGrid, Markdown

📥 Import

Download workflow.json and import into n8n: Workflow menu → Import from File

📖 Importing guide · 🔑 Credential setup