Projects
AI Agent / Scraping-10 / 11

Google Maps Lead Generator: Multi-source AI scraping agent

Conversational AI agent that collects business leads from Google Maps via Apify, enriches data by crawling websites, falls back to SerpAPI when needed, and stores everything in Google Sheets. Multilingual, GDPR compliant (public data only).

n8nOpenAI gpt-4o-miniApifyGoogle Maps ScraperSerpAPIGoogle SheetsLangChain
Google Maps Lead Generator: Multi-source AI scraping agent
Google Maps

Primary source

Website + SerpAPI

Enrichment

Google Sheets

Storage

Context

B2B sales reps and agencies waste a huge amount of time manually building local prospect databases: searching on Google Maps, copying contact info, visiting each website to grab emails, deduplicating. For 100 prospects, that's easily 4-6 hours. And you have to start over for each new city/sector.

The challenge

Build a conversational AI agent capable of orchestrating multiple scraping tools based on user request context, while respecting specific API constraints (ISO 3166 Alpha-2 lowercase country codes, URLs without quotation marks), with smart error handling, deduplication via Google Sheets, and GDPR compliance (public data only).

The solution

n8n workflow with a Chat Trigger that fires up an AI Agent (gpt-4o-mini) with contextual memory (last 50 turns) and 3 tools: (1) extract_google_maps via Apify Actor, (2) Website_Content_Crawler to enrich with website content, (3) SerpAPI as a fallback if data is incomplete. Very strict system prompt (8 sections: Task, Context, Ethics, Constraints, Quality, Interaction, Examples, Output Format). Dedicated subworkflows for Google Maps + Website Crawler with automatic Google Sheets append.

Key features

  • 01Chat Trigger: natural conversational interaction with the agent
  • 02gpt-4o-mini AI Agent with structured system prompt (8 sections)
  • 03Conversational memory: last 50 turns (Window Buffer)
  • 04extract_google_maps tool: Apify Google Maps Scraper (place name, address, phone, website, email, hours)
  • 05Website_Content_Crawler tool: Apify to extract website content in Markdown
  • 06SerpAPI fallback tool: web search if Google Maps data is incomplete
  • 07Auto validation of ISO 3166 Alpha-2 country codes (lowercase)
  • 08Dedicated subworkflows: 1 for Google Maps, 1 for Website Crawler
  • 09Auto Google Sheets append for Maps + separate sheet for web content
  • 10Result aggregation before returning to the agent
  • 11GDPR compliant: public business data only, no sensitive data
  • 12Google Sheets deduplication check before new scraping