Lead Generation Scraper for Google Maps Listings - n8n Workflow

Automate B2B lead generation by using this n8n workflow to scrape websites from Google Maps search results, extract business emails, and save the data to Google Sheets.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

This n8n workflow template is ideal for:
Sales Development Representatives (SDRs): Seeking targeted, high-quality lead lists based on geographical criteria.
Marketing Agencies: Automating prospecting for local businesses.
Data Engineers: Looking for robust examples of web scraping using the n8n node architecture.
Anyone needing a custom n8n workflow to extract public business data securely.

Overview

Lead generation requires current and accurate contact information. Manually clicking through hundreds of Google Maps listings is impractical. This robust n8n workflow solves this by providing a hands-free solution to extract potential client emails from businesses listed in a Google Maps search result (e.g., 'dentists in Calgary'). The design prioritizes cleanliness and safety, using multiple filtering and delay steps (Wait n8n node) to prevent rate limiting. This n8n workflow template showcases how to leverage the Code n8n node for advanced regex-based data extraction, transforming a raw HTML scrape into a structured list of actionable leads stored directly in Google Sheets. It's an essential example among powerful n8n templates for accelerating B2B outreach.

How it Works

The entire process is initiated by the manual n8n trigger, which starts the data extraction sequence.


  1. Initial Scrape: The n8n workflow starts by executing an HTTP Request n8n node (Scrape Google Maps) against the pre-configured Google Maps URL to fetch the search results HTML.

  2. URL Extraction: A Code n8n node (Extract URLs) uses regex to parse the raw HTML and identify all internal and external website links, transforming them into individual items.

  3. Filtering & Limiting: The Filter Google URLs n8n node cleans the list by removing unwanted links (e.g., Google tracking, schema data, Wix/Sentry analytics domains). The list is then deduplicated and limited (using the Limit n8n node) to 100 items for controlled execution.

  4. Iterative Scraping: The Loop Over Items n8n node iterates through each cleaned website URL. Inside this loop, a Wait n8n node introduces a delay, and the Scrape Site HTTP Request n8n node fetches the content of the individual business website.

  5. Email Extraction: The second Code n8n node (Extract Emails) applies a specialized regex pattern to extract valid email addresses from the website's HTML.

  6. Final Output: The workflow filters out empty results, splits the array of extracted emails into separate rows, removes any final duplicates, and uses the Google Sheets n8n node (Add to Sheet) to append the high-quality, verified leads into your target spreadsheet.

Installation Guide

To use this n8n workflow, follow these steps:


  1. Import: Copy the provided JSON and import it into your n8n instance using the 'New' menu -> 'Import from JSON'.

  2. Google Sheets Credentials: Click the Add to Sheet n8n node and set up your Google Sheets OAuth2 API credentials if you haven't already. You will need to select the desired Google Sheet Document ID and Sheet Name.

  3. Customize Scrape URL: Update the Scrape Google Maps HTTP Request n8n node. Change the URL parameter to the specific Google Maps search query you wish to target (e.g., changing 'carpinteros en tarragona' to your desired city and industry).

  4. Set Up Trigger: Since this uses a manual n8n trigger, simply click 'Activate' (if desired for future scheduled runs) or click 'Test Workflow' to start immediate execution.

Node Details

When clicking ‘Test workflow’ (manualTrigger): Serves as the n8n trigger to manually start the scraping process on demand.
Scrape Google Maps (httpRequest n8n node): Fetches the initial HTML content of the target Google Maps search results page. Key Configuration: URL points to the specific geographical business search.
Extract URLs (Code n8n node): Essential for transforming the raw HTML response into a list of usable website URLs using a simple regex (/https?:\/\/[^\/\s"'>]+/g).
Filter Google URLs (Filter n8n node): Cleans the list by excluding URLs containing terms like 'google', 'gstatic', and various tracking domains, ensuring only business websites are targeted.
Limit (Limit n8n node): Restricts the number of websites processed in a single run (set to 100), enhancing stability and managing server load.
Scrape Site (httpRequest n8n node): Fetches the HTML of each individual business website. Key Configuration: Follow Redirects is set to 'false' to efficiently capture the initial page data.
Extract Emails (Code n8n node): The core extraction logic. Uses a robust regex pattern to identify valid email structures (/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.(?!jpeg|jpg|png|gif|webp|svg)[a-zA-Z]{2,}/g) while avoiding file extensions like .jpg or .png.
Wait & Wait1 (Wait n8n node): Crucial for rate limiting, adding controlled delays (1 second) between requests to protect the scraper from being blocked by target websites.


  • Add to Sheet (Google Sheets n8n node): The final action n8n node, appending the cleaned and deduplicated list of emails to the specified Google Sheet document.

Related n8n Workflows

Free

Nodes: 11 Nodes
Updated: December 26 2025
View all
Created by

Automation & Growth Engineer | Founder of Automation Hub I build practical, AI-powered workflows that help creators and businesses automate daily tasks, track performance, and make smarter decisions — all without code. Passionate about turning complex systems into simple, scalable automations.

Featured*