Lead Extraction from Google Maps to Google Sheets - n8n Workflow

Automate B2B lead generation by extracting business contact information directly from Google Maps search results using this powerful n8n workflow and saving data to Google Sheets.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Sales professionals needing fresh B2B contact lists.

  • Marketing agencies performing localized lead generation.

  • Data analysts looking for powerful n8n templates for complex web scraping.

  • Users seeking an automated way to transform raw web data into organized spreadsheets using n8n.

Overview

This advanced n8n workflow is designed to streamline lead generation by automating the extraction of structured business data from Google Maps. It addresses the common challenge of manual data collection, providing a repeatable and efficient method for building targeted prospect lists. By utilizing a custom JavaScript n8n node for regex parsing raw HTML scraped via an HTTP request, this solution ensures high-quality data extraction—including names, addresses, phone numbers, websites, and potential emails. The resulting leads are then neatly organized in Google Sheets. This specific n8n workflow demonstrates how to leverage custom code and standard requests to create powerful data collection solutions.

How it Works


  1. Trigger and Initialization: The n8n workflow starts using the Manual n8n trigger. The 'Set Form Fields' n8n node initializes the target criteria: the type of business (lead_type) and the geographic location (location).

  2. URL Construction: The 'Build Search URL' n8n node uses custom JavaScript to dynamically construct the specific Google Maps search URL required for the scraping request, formatting the inputs correctly.

  3. Web Scraping: The 'Scrape Google Maps1' n8n node (an HTTP Request n8n node) executes the constructed URL, fetching the raw HTML content of the Google Maps search results page.

  4. Data Extraction (Regex): The core intelligence resides in the 'Extract Business Info' n8n node. This custom script employs multiple JavaScript Regular Expressions to systematically parse the massive HTML payload and isolate key fields: business name, phone number, address, website, and email. The result is a clean list of structured JSON objects.

  5. Data Storage: Finally, the extracted lead data is passed to the 'Save to Google Sheets' n8n node, which connects to your configured Google account and appends each extracted business as a new row. This completes the fully automated lead generation n8n workflow.

Installation Guide


  1. Import the n8n template: Copy the provided JSON code and paste it into your n8n instance using the 'New' -> 'Import from JSON' option.

  2. Configure Google Sheets Credentials: Navigate to the 'Save to Google Sheets' n8n node and create or select your Google Sheets OAuth2 API credential. Ensure it has permissions to write data.

  3. Set Google Sheet Target: In the 'Save to Google Sheets' n8n node, replace yourgooglesheetidhere with the actual ID of your target spreadsheet.

  4. Customize Search Parameters: Modify the 'Set Form Fields' n8n node to change the lead_type (e.g., 'Dentists', 'Lawyers') and location (e.g., 'London', 'California') to match your target market.

  5. Test the n8n workflow: Click the 'Test workflow' button on the n8n trigger to run a test execution and verify the data lands correctly in your Google Sheet.

Node Details

When clicking ‘Test workflow’ (Manual Trigger n8n trigger): This simple n8n trigger starts the data extraction process, ideal for development and testing this n8n workflow.
Set Form Fields (Set n8n node): Defines the parameters for the search query, including lead_type and location. This is the primary n8n node for customizing the workflow's target.
Build Search URL (Code n8n node): A custom JavaScript n8n node that dynamically constructs the Google Maps search URL based on the defined inputs.
Scrape Google Maps1 (HTTP Request n8n node): Executes the web scraping operation against the generated URL, retrieving the raw HTML data which is essential for the next step in the n8n workflow.
Extract Business Info (Code n8n node): This advanced n8n node uses multiple, specific Regular Expressions (businessRegex, phoneRegex, etc.) to meticulously parse the raw HTML and structure the business contact information into usable JSON objects.
Save to Google Sheets (Google Sheets n8n node): Connects to your configured Google Sheets account and uses the append operation to write the extracted, structured lead data (Name, Phone, Email, Address, Website) into designated columns.

Related n8n Workflows

Free

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

AI Automation Expert | AI Call Center with Voho

Featured*