All Projects

AI Lead Machine Agent

AI Lead Machine Agent

AI Lead Machine Agent

A fully automated local business lead generation and cold email outreach engine. Users submit a form specifying business type (e.g., "Plumber"), location (e.g., "Rome, Italy"), desired number of leads, and preferred email style (Friendly/Professional/Simple). The system scrapes Google Maps via Apify to collect business listings, filters results for those with websites, uses Google Gemini AI to extract email addresses from each business website, validates the emails, logs valid leads to Google Sheets, then loops through each lead with a 1-minute delay between sends -- using OpenAI GPT-4.1-mini to generate customized cold emails based on the company name, category, and selected tone -- sends via Gmail, and updates the sheet with send status and timestamp.

Tech Stack

LayerTechnology
Automation Platformn8n
Lead ScrapingApify (Google Maps Scraper Actor)
Email Extraction AIGoogle Gemini
Cold Email Generation AIOpenAI GPT-4.1-mini
Email DeliveryGmail
Data StorageGoogle Sheets
Rate Limitingn8n Wait node (1-minute delay between sends)
Triggern8n Form (business type, location, lead count, email style)

Workflow Architecture

Form Submission (business type, location, count, style)
  -> Apify: Scrape Google Maps (business listings)
    -> Filter: Only businesses with websites
      -> Google Gemini: Extract Email from Website
        -> IF email contains "@":
          -> Google Sheets: Append Lead (company, category, website, phone, email, address)
            -> Loop Over Items (batch processing)
              -> Wait 1 minute (rate limiting)
                -> OpenAI GPT-4.1-mini: Generate Cold Email (subject + body)
                  -> Edit Fields (timestamp + email)
                    -> Gmail: Send Cold Email
                      -> Google Sheets: Update Status + Send Time
                        -> Next Lead (loop)
        -> ELSE: No Operation (skip invalid)

Business Outcomes

MetricImpact
Lead generation speedScrapes and processes 10-50+ local business leads in a single execution
Zero manual prospectingEliminates Google Maps browsing, website visiting, email hunting entirely
AI-personalized cold emailsEach email uniquely generated per company with chosen tone (Friendly/Professional/Simple)
Email deliverabilityValidated "@" check prevents bounced emails from invalid extractions
Send rate management1-minute delay between sends prevents Gmail rate limiting and spam flags
Complete audit trailEvery lead logged with company, category, website, phone, email, address, send status, and timestamp
Configurable campaignsUsers control business type, geography, volume, and email tone per campaign

Technical Metrics

MetricValue
Nodes in workflow14
AI model calls per lead2 (Gemini for email extraction + GPT-4.1-mini for cold email)
External integrations5 (Apify, Google Gemini, OpenAI, Gmail, Google Sheets)
Rate limiting1-minute wait between email sends
Email validationString contains "@" check
Data points per lead6 (company name, category, website, phone, email, address)
Tracking fields2 (Cold Mail Status, Send Time)
Configurable parameters4 (business type, location, lead count, email style)

Estimated Cost Savings (If Implemented)

ItemManual CostAutomated Cost
Manual prospecting per lead (20 min @ $20/hr)$6.67/lead~$0.03 (Apify + AI APIs)
Email research + validation (10 min @ $20/hr)$3.33/leadIncluded in Gemini call
Cold email writing (8 min @ $20/hr)$2.67/lead~$0.01 (GPT-4.1-mini)
200 leads/month$2,534/month~$8/month
Annual savings (200 leads/mo)--~$30,000/year
Time saved per campaign (50 leads)~31 hours manual~1 hour automated
// NEXT STEP

Have a similar bottleneck?

Get a free automation audit. We'll map the system that takes the manual work off your team.