Automate Lead Generation with n8n and Google Maps Scraper

This n8n workflow automates extracting professional business leads from Google Maps and websites, solving tedious manual data collection for accurate lead generation. It delivers organized contact details directly to Google Sheets, saving hours of work.
agent
toolWorkflow
httpRequest
+8
Workflow Identifier: 1321
NODES in Use: chatTrigger, agent, lmChatOpenAi, memoryBufferWindow, toolWorkflow, toolSerpApi, stickyNote, executeWorkflowTrigger, httpRequest, googleSheets, aggregate

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

Visit through Desktop for Best experience

What this workflow does

This workflow collects business leads by searching Google Maps and company websites automatically.

It fixes slow, error-prone manual work by organizing lead data and saving it to Google Sheets.

The main purpose is to save time and avoid mistakes in lead gathering.

The result is faster, more accurate lead lists ready for sales outreach.


Key tools and services

  • n8n automation platform: Runs the workflow and connects nodes.
  • OpenAI: Uses GPT-4o AI for understanding requests and data processing.
  • Google Sheets API: Stores and updates lead data records.
  • Apify API: Scrapes Google Maps and website content.
  • SerpAPI: Performs fallback Google searches when scraping is incomplete.

Inputs, Processing, and Outputs

Inputs

  • User message containing search terms, city, state, and country code.
  • Google Maps business listings via Apify API.
  • Website URLs to extract detailed content.

Processing steps

  • The Webhook node receives user messages and starts the workflow.
  • AI Agent – Lead Collection interprets input with ethical and format rules.
  • GPT-4o – Generate & Process Requests plans requests and data flow.
  • Memory – Track Recent Context maintains conversation history to keep answers consistent.
  • Scrape Google Maps (via Apify) gathers business data filtered by user criteria.
  • Save Extracted Data to Google Sheets appends results to a spreadsheet.
  • Aggregate Business Listings consolidates data for easier review.
  • Tool – Crawl Business Website launches subworkflow to get website details.
  • Scrape Website Content (via Apify) extracts content from websites for lead enrichment.
  • Save Website Data to Google Sheets stores enriched info in another sheet.
  • Aggregate Website Content combines website details for AI use.
  • Fallback – Enrich with Google Search uses SerpAPI when other data is missing.

Output

  • A clean spreadsheet with detailed, checked business leads for outreach.
  • Improved lead quality by avoiding duplicates and adding website info.
  • More efficient workflow enabling faster sales contact.

Beginner step-by-step: How to build this in n8n

Download and Import

  1. Download the workflow file using the Download button on this page.
  2. Go into the n8n editor where you want the workflow to run.
  3. Use “Import from File” option to upload the workflow JSON.

Configure Credentials

  1. Open each node requiring keys: OpenAI, Apify, Google Sheets, SerpAPI.
  2. Add valid API Keys exactly as given by each service.
  3. Update Google Sheets Document IDs and sheet names where data should be saved.
  4. Check any email addresses, URLs, or folder names and adjust to your setup.

Test and Activate

  1. Send a test message like “Find carpenters in San Francisco, US” to the workflow webhook.
  2. Watch the workflow run and check spreadsheet for results.
  3. Fix any API or ID errors if data does not appear correctly.
  4. Once tested, activate the workflow using the toggle switch for live use.

Extra Notes

  1. For better performance, consider self-host n8n.
  2. Make sure API limits for OpenAI and Apify are enough for expected usage.

Customization ideas

  • Increase or decrease the max number of places scraped by editing maxCrawledPlacesPerSearch in the Google Maps scrape node JSON.
  • Change the target Google Sheets Document ID and sheet names in related nodes to store data in preferred files.
  • Edit the AI Agent system prompt to focus on specific business types or add filters.
  • Add new search parameters like skipClosedPlaces or business categories by expanding the JSON body sent to the Apify API.

Handling errors and failures

No data from Google Maps Scraper API

Check that the country code is lowercased, like “us” not “US”.

Verify the city name is correct and spelled right.

Authorization or API key errors

Make sure API keys for Apify, OpenAI, Google Sheets, and SerpAPI are valid and not expired.

Re-enter keys in node credential sections.

JSON formatting problems

Use the n8n JSON editor to avoid syntax mistakes.

Test JSON in online validators before saving to prevent errors.


Summary of results

✓ Save 8+ hours weekly by automating lead data collection.

✓ Prevent errors and duplicates in lead information.

→ Get organized spreadsheets with complete business details.

→ Enable faster outreach with enriched data from websites and search.

Frequently Asked Questions

It sends a POST request to the Apify Google Maps Scraper API with search terms, city, and country code to gather business listings.
Verify the Google Sheets Document ID and sheet names are correctly set, and check that proper OAuth credentials are used.
Yes, but HTTP request nodes must be modified to match the alternative scraping APIs and their JSON payload formats.
The AI Agent node uses validation rules to detect duplicates and removes repeated entries before saving.

Promoted by BULDRR AI

Related Workflows

Automate Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation Workflows in n8n

A complete beginner guide to building an AI SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free