Skip to main content

Scrape B2B leads from Google Maps to Google Sheets with HasData

Workflow preview

Workflow preview
100%
Scrape B2B leads from Google Maps to Google Sheets with HasData preview
Open on n8n.io

1. Workflow Overview

This n8n template shows how to build a complete B2B lead generation pipeline that scrapes Google Maps for businesses and enriches them with emails from their websites or Google search. Use cases: F...

Best for

  • Lead Generation automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.manualtrigger, n8n-nodes-base.googlesheets, n8n-nodes-base.code, @hasdata/n8n-nodes-hasdata.hasdata, n8n-nodes-base.splitout, n8n-nodes-base.removeduplicates, n8n-nodes-base.if

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by HasData.

Original n8n.io source

1.1 Workflow description

Title
Scrape B2B leads from Google Maps to Google Sheets with HasData
Workflow name
Scrape B2B leads from Google Maps to Google Sheets with HasData

This n8n template shows how to build a complete B2B lead generation pipeline that scrapes Google Maps for businesses and enriches them with emails from their websites or Google search.

Use cases: Find local businesses with contact info for cold email campaigns, B2B prospecting, market research, or building CRM databases.

How it works

  1. You define search queries, locations, and page counts in a config sheet inside a Google Spreadsheet called "Leads".
  2. On each run, the workflow creates a new timestamped results sheet so previous runs don't get overwritten.
  3. It reads every row from config, generates paginated search tasks (20 results per page), and fires them at the HasData Google Maps API.
  4. Results get split into individual businesses. Duplicates are removed by name and place ID.
  5. For each business with a website, the HasData web scraper hits the URL directly and pulls any emails it finds.
  6. If no emails turn up on the website, or there's no website at all, the workflow runs a targeted Google search: "business name, city" email "@" and parses the organic results with a regex.
  7. All leads (whether emails came from the site or from Google) merge into one stream and get written to the results sheet: name, phone, address, website, emails, rating, reviews, type.

How to set up

  1. Install the HasData n8n node on your self-hosted instance.
  2. Connect your HasData API credentials and your Google Sheets OAuth2 credentials inside the workflow.
  3. In your Google Spreadsheet named Leads, add a sheet called config with these columns:
  • leads_query for the search term (e.g. coffee shops)
  • location for city, state, zip code, or a specific address
  • page_count for number of pages to fetch (20 results per page)
  • offset for starting page number (use 1 to start from the beginning)
  1. Click Manual Trigger to run.

Requirements

  • Self-hosted n8n (community node required)
  • HasData account with API key
  • Google account with Sheets API access (OAuth2)
  • Google Spreadsheet named Leads with a config sheet

Customizing this workflow

  • Swap the Manual Trigger for a Schedule trigger to run nightly lead generation automatically.
  • Add a filter node after "Remove Duplicates" to target only businesses above a minimum rating.
  • Extend the "Format Lead" nodes to capture additional fields from the Maps API like categories, hours, or social links.
  • Point the output to a CRM via HTTP Request instead of Google Sheets.

Further reading

The full build walkthrough, including real test results, node-by-node screenshots, and the regex logic behind the Google search fallback, is on the HasData blog: How to scrape leads with n8n.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 2 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 3 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 4 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 5 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 6 - Sticky Note5

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 7 - Sticky Note6

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 8 - Start Lead Generation

Type / Role
n8n-nodes-base.manualTrigger - manualTrigger
Config choices
Version 1

Block 9 - Create Leads Sheet

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 10 - Read Configurations

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 11 - Initialize Search Tasks

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 12 - Search in Google Maps

Type / Role
@hasdata/n8n-nodes-hasdata.hasData - hasData
Config choices
Version 1

Block 13 - Split Local Results

Type / Role
n8n-nodes-base.splitOut - splitOut
Config choices
Version 1

Block 14 - Deduplicate Local Results

Type / Role
n8n-nodes-base.removeDuplicates - removeDuplicates
Config choices
Version 2

Block 15 - Check Website Availability

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.3

Block 16 - Scrape Website Data

Type / Role
@hasdata/n8n-nodes-hasdata.hasData - hasData
Config choices
Version 1

Block 17 - Check for Emails

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.3

Block 18 - Format Lead With Contact

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 19 - Format Lead Without Contact

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 20 - Merge Leads for Google Search

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3.2

Block 21 - Find Emails Via Google

Type / Role
@hasdata/n8n-nodes-hasdata.hasData - hasData
Config choices
Version 1

Block 22 - Extract Emails

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 23 - Combine All Leads

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3.2

Block 24 - Append to Leads Sheet

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

3. Summary Table

Workflow Scrape B2B leads from Google Maps to Google Sheets with HasData
Complexity advanced
Nodes 24
Categories Lead Generation
Author HasData
Published 12 May 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/15653/15653.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Scrape B2B leads from Google Maps to Google Sheets with HasData do?

This n8n template shows how to build a complete B2B lead generation pipeline that scrapes Google Maps for businesses and enriches them with emails from their websites or Google search. Use cases: F...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Lead Generation use case.