An advanced, AI-powered Lead Generation System designed to automate and streamline your entire outreach workflow — from data collection to enrichment and personalized contact automation.
This repository contains three core agents, each handling a different stage of the lead generation process:
1. Lead Generation Agent
2. Google Maps to Email Scraper (with Google Sheets Export)
3. LinkedIn Automation & Personalization (Lead Enrichment)
This system automates the tedious parts of prospecting — finding, collecting, cleaning, enriching, and personalizing leads — so you can focus on closing deals and building real relationships.
Each agent can run independently or connect together in a full workflow:
- Start with a Google Maps search to collect businesses and emails
- Enrich those leads with AI-based context and industry data
- Personalize and automate outreach through LinkedIn
You can customize every stage to match your niche, target audience, or campaign style.
This automation triggers every time someone submits the Lead Machine Form. It then executes the following steps:
-
Scrapes Business Data
- Collects company name, website, phone, address, and category using Apify based on business type and location.
-
Extracts Email Addresses
- Uses Google Gemini AI to extract and verify the best email from each business website.
-
Stores Leads in Google Sheets
- Saves only valid leads with complete details.
-
Generates Cold Email Content
- Creates personalized subject lines and email bodies using AI, matching your preferred tone (Friendly, Professional, Simple).
-
Sends Cold Emails via Gmail
- Automatically sends the emails to each lead and logs results.
-
Updates Status in Google Sheets
- Tracks sent status, timestamps, and outcomes for each contact.
To set up this workflow, you’ll need to configure each integration step:
-
Form Trigger
- Customize the “Lead Machine” form fields (Business Type, Location, Lead Number, Email Style).
-
Apify API
- Add your Apify Actor Endpoint URL in the HTTP Request node for data scraping.
-
Google Gemini
- Add credentials for AI-based email extraction and validation.
-
Google Sheets
- Connect your sheet for storing leads and email status.
-
OpenAI
- Add your credentials for AI-based cold email generation.
-
Gmail
- Connect your Gmail account to send personalized cold emails automatically.
You can easily tailor this system to match your goals and brand:
-
✏️ Change AI Email Prompts
- Adjust the tone, structure, or message style to align with your brand voice or offer.
-
🎯 Add Filters
- Only target leads that meet certain conditions (e.g., verified emails, active websites, specific industries).
-
📊 Modify Google Sheets Structure
- Add custom columns like “Follow-up Date,” “Lead Source,” or “Email Status.”
-
📬 Switch Email Provider
- Replace Gmail with another email provider or SMTP integration if needed.
Once configured, this workflow becomes your AI-powered Lead Machine — finding businesses, extracting contacts, generating personalized cold emails, and sending them automatically while keeping everything tracked in one place.
No manual scraping, no repetitive outreach — just smart, scalable lead generation.
Categories: Lead Generation · Web Scraping · Business Automation
This workflow creates a completely free Google Maps email scraping system that extracts unlimited business emails — without using expensive third-party APIs.
Built entirely in n8n using simple HTTP requests and JavaScript, this system can generate thousands of targeted leads for any industry or location while operating at a 99% free cost structure.
- 💰 Zero API Costs — Operates entirely through free Google Maps scraping without expensive third-party services
- ♾️ Unlimited Lead Generation — Extract emails from thousands of Google Maps listings across any industry
- 🌍 Geographic Targeting — Search by specific cities, regions, or business types for precise lead targeting
- ⚙️ Complete Automation — From search query to organized email list with minimal manual work
- 🧹 Built-in Data Cleaning — Automatic duplicate removal, filtering, and data validation
- 🚀 Scalable Processing — Handles hundreds of businesses per search with intelligent rate limiting
- Uses strategic HTTP requests to Google Maps search URLs
- Processes queries like
"Calgary dentist"or"Miami lawyers"to extract business listings - Bypasses API restrictions using direct HTML scraping techniques
- Custom JavaScript regex patterns extract website URLs from Google Maps data
- Filters out irrelevant domains (Google, schema, static files)
- Returns a clean list of actual business websites for processing
- Loop-based architecture prevents IP blocking through intelligent batching
- Built-in delays and redirect handling for reliability
- Processes each website individually with error handling
- Advanced regex patterns identify email addresses within website HTML
- Extracts contact emails, info emails, and administrative addresses
- Handles multiple email formats and validation patterns
- Automatically removes duplicate emails across all processed websites
- Filters null entries and invalid formats
- Exports clean, organized email lists directly to Google Sheets
Create a Google Sheet with the following two tabs:
| Column | Description |
|---|---|
searches |
Contains your search queries (e.g., Calgary dentist, Miami lawyers) |
| Column | Description |
|---|---|
emails |
Contains extracted email addresses from all processed websites |
- Create a Google Sheet with two tabs: "searches" and "emails"
- Add your target search queries to the searches tab (one per row)
- Connect Google Sheets OAuth credentials in n8n
- Update your Google Sheets Document ID in all sheet nodes
The workflow reads search queries from the first sheet and exports all extracted emails to the second sheet automatically.
- 🧰 Local Service Providers — Find competitors and potential partners in specific geographic areas
- 💼 B2B Sales Teams — Generate targeted prospect lists for cold outreach campaigns
- 🎯 Marketing Agencies — Build industry-specific lead databases for clients
- 🏘️ Real Estate Professionals — Identify businesses in target neighborhoods for commercial outreach
- 🏪 Franchise Development — Research potential markets and existing competition
- 📊 Market Research — Analyze business density and contact info across regions
This system transforms the economics of lead generation:
- $0 per lead vs. $2–$5 per lead from paid databases
- Process 1,000+ leads daily without hitting API limits
- Sell as a done-for-you lead service for $500–$2,000 per industry or location
- Perfect for agencies offering local business lead generation
- Difficulty Level: Intermediate
- Estimated Build Time: 1–2 hours
- Monthly Operating Cost: $0 (completely free)
- Set up a manual trigger for testing and Google Sheets integration
- Configure initial HTTP Request node for Google Maps searches
- Enable SSL ignore and response headers for stable responses
- Add a JavaScript code node with custom regex patterns
- Process input data from Google Maps HTML responses
- Implement URL filtering to remove irrelevant domains
- Add a “Split in Batches” node for intelligent looping
- Configure HTTP requests with delays and redirect handling
- Add error handling for non-scrapable sites
- Implement a JavaScript code node with email regex patterns
- Validate email formats and handle multiple results per site
- Aggregate all valid emails for export
- Filter out null or duplicate entries
- Use “Split Out” to merge all emails into one list
- Connect Google Sheets integration for export
- Use Limit nodes during testing to prevent IP blocks
- Start small before scaling
- Add proxy integration for higher volume scraping
Scale the system even further with:
- Multi-Page Scraping: Scrape homepages and “Contact” pages for more emails
- Proxy Integration: Add residential proxies for unlimited scraping
- Industry Templates: Pre-configure searches by niche or industry
- Contact Data Expansion: Extract phone numbers, addresses, and social media profiles
- CRM Integration: Push leads directly to your CRM or sales pipeline
- 🕒 Rate Limiting: Built-in delays prevent IP blocking during normal use
- 📈 Scalability: For heavy scraping, use proxies for higher throughput
- ⚖️ Compliance: Always ensure proper data use and privacy compliance
- ✅ Data Quality: Automated filters reduce noise, but manual checks are recommended for high-value campaigns
The Google Maps Email Scraper System is a cost-free, scalable solution for generating business leads with zero paid APIs.
Whether you're a marketer, freelancer, or agency owner, this system gives you the ability to find and extract leads for any industry or location — fast, free, and fully automated.
This system automates LinkedIn lead generation and enrichment through a six-stage process that connects Apollo.io, LinkedIn Data API, and Google Sheets — providing verified emails, detailed profiles, and personalized outreach insights.
This automation runs in six clear stages:
- Automatically pulls leads based on keywords, job roles, or industries using Apollo’s API.
- Captures essential data: name, job title, company, LinkedIn profile URL, and Apollo User ID.
- Can be triggered through form submission, webhook, WhatsApp, Telegram, or any custom trigger that passes search parameters.
- Extracts usernames from LinkedIn profile URLs using a lightweight script node.
- These usernames are required for further enrichment through RapidAPI (LinkedIn Data API).
- Fetches verified work emails using the Apollo User ID.
- Adds a double-verification layer via mails.so — checking MX records and deliverability to remove invalid or inactive emails.
- Uses the LinkedIn Data API to enrich each lead with their bio, summary, and headline.
- Helps you understand the lead’s expertise, company focus, and professional background.
- Collects the lead’s recent posts and reposts to identify what they are currently engaging with.
- Enables personalized messaging for outreach (e.g., referencing their latest post or shared topic).
- All enriched data is automatically written into a Google Sheet.
- New columns are added dynamically without deleting existing information.
- The sheet stays fully synced with status tracking (done / failed / pending).
Each workflow includes built-in fail-safe retry logic to maintain full data coverage:
- Tracks status for every lead:
- ✅ done — processed successfully
- ❌ failed — issue occurred (auto-retry scheduled)
- ⏳ pending — waiting for next run
- Failed rows are automatically retried after a custom delay (e.g., 2 weeks).
- Guarantees minimal drop-offs and maximum completion.
Make copies of these two template sheets:
- Template 1: Apollo Leads Scraper & Enrichment
- Template 2: Final Enriched Leads
The system will append data (emails, bios, activities, etc.) step by step as enrichment progresses.
- Sign up and generate your API key at the Apollo Developer Portal.
- Enable the “Master API Key” option so one key works across all endpoints.
- Subscribe at RapidAPI – LinkedIn Data.
- Use your key in the
x-rapidapi-keyheader field for enrichment requests.
- Get your API key from your mails.so dashboard.
- Used for validating and filtering undeliverable or inactive email addresses.
- Ensure that all API keys (Apollo, RapidAPI, mails.so) are active and correct.
- Apollo’s “Master API Key” must be enabled.
- Keys should be saved as Generic Credentials inside n8n.
- Broaden search queries — overly specific filters can return zero results.
- Verify that Apollo is returning valid data for your search parameters.
- Check that Apollo results include complete LinkedIn profile URLs.
- Invalid or missing URLs will cause username extraction to fail.
- Apollo may not have verified emails for all leads.
- mails.so may filter out invalid or expired addresses — review logs for details.
- Ensure the Google Sheet is shared with the account connected to n8n.
- Check for matching column headers and correct formatting (no merged cells).
- Each row must include a
done,failed, orpendingvalue. - Missing status fields will prevent retry logic from triggering.
- Confirm that each lead has a valid LinkedIn username.
- Check your RapidAPI subscription limits — ensure your plan is active.
- Verify that the trigger node (form, webhook, etc.) is enabled.
- Confirm you’re passing all required input parameters (keyword, role, etc.).
Once configured, this workflow becomes a fully automated LinkedIn Lead Machine — discovering new leads, verifying their emails, enriching their profiles, and organizing everything in Google Sheets for personalized outreach.
You get verified, enriched, and ready-to-contact leads with minimal manual input — ideal for sales teams, agencies, and B2B marketers.