Skip to main content

Automate lead generation from Google Search & Maps to Google Sheets

Workflow preview

Workflow preview
100%
Automate lead generation from Google Search & Maps to Google Sheets preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

This n8n template from Intuz provides a complete solution to automate on demand lead generation. It acts as a powerful scraping agent that takes a simple chat query, scour...

Best for

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

Tools used

@n8n/n8n-nodes-langchain.chattrigger, n8n-nodes-base.if, n8n-nodes-base.googlesheets, n8n-nodes-base.removeduplicates, n8n-nodes-base.splitinbatches, n8n-nodes-base.code, n8n-nodes-base.httprequest, n8n-nodes-base.filter

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Automate lead generation from Google Search & Maps to Google Sheets
Workflow name
Automate lead generation from Google Search & Maps to Google Sheets

This n8n template from Intuz provides a complete solution to automate on-demand lead generation.

It acts as a powerful scraping agent that takes a simple chat query, scours both Google Search and Google Maps for relevant businesses, scrapes their websites for contact details, and compiles an enriched lead list directly in Google Sheets.

Who's this workflow for?

  • Sales Development Representatives (SDRs)
  • Local Marketing Agencies
  • Business Development Teams
  • Freelancers & Consultants
  • Market Researchers

How it works

1. Start with a Chat Query: The user initiates the workflow by typing a search query (e.g., "dentists in New York") into a chat interface.

2. Multi-Source Search: The workflow queries both the Google Custom Search API (for web results across multiple pages) and scrapes Google Maps (for local businesses) to gather a broad list of potential leads.

3. Deep Dive Website Scraping: For each unique business website found, the workflow visits the URL to scrape the raw HTML content of the page.

4. Intelligent Contact Extraction: Using custom code, it then parses the scraped website content to find and extract valuable contact information like email addresses, phone numbers, and social media links.

5. Deduplicate and Log to Sheets: Before saving, the workflow checks your Google Sheet to ensure the lead doesn't already exist. All unique, newly enriched leads are then appended as clean rows to your sheet, along with the original search query for tracking.

Key Requirements to Use This Template

1. n8n Instance & Required Nodes:

  • An active n8n account (Cloud or self-hosted).
  • This workflow uses the official n8n LangChain integration (@n8n/n8n-nodes-langchain) for the chat trigger. If you are using a self-hosted version of n8n, please ensure this package is installed.

2. Google Custom Search API:

  • A Google Cloud Project with the "Custom Search API" enabled.
  • You will need an API Key for this service.
  • You must also create a Programmable Search Engine and get its Search engine ID (cx). This tells Google what to search (e.g., the whole web).

3. Google Sheets Account:

  • A Google account and a pre-made Google Sheet with columns for Business Name, Primary Email, Contact Number, URL, Description, Socials, and Search Query.

Setup Instructions

1. Configure the Chat Trigger:

  • In the "When chat message received" node, you can find the Direct URL or Embed code to use the chat interface.

Set Up Google Custom Search API (Crucial Step):

  • Go to the "Custom Google Search API" (HTTP Request) node.
  • Under "Query Parameters", you must replace the placeholder values for key (with your API Key) and cx (with your Search Engine ID).

3. Configure Google Sheets:

  • In all Google Sheets nodes (Append row in sheet, Get row(s) in sheet, etc.), connect your Google Sheets credentials.
  • Select your target spreadsheet (Document ID) and the specific sheet (Sheet Name) where you want to store the leads.

4. Activate the Workflow:

  • Save the workflow and toggle the "Active" switch to ON.
  • Open the chat URL and enter a search query to start generating leads.

Connect with us

For Custom Workflow Automation

Click here- Get Started

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 - When chat message received

Type / Role
@n8n/n8n-nodes-langchain.chatTrigger - chatTrigger
Config choices
Version 1.3

Block 2 - If

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

Block 3 - Append row in sheet

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

Block 4 - Remove Duplicates

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

Block 5 - Loop Over Items

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Block 6 - Extract URLs

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

Block 7 - Scrape Google Maps

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 8 - Filter Google URLs

Type / Role
n8n-nodes-base.filter - filter
Config choices
Version 2.2

Block 9 - Wait2

Type / Role
n8n-nodes-base.wait - wait
Config choices
Version 1.1

Block 10 - Get row(s) in sheet

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

Block 11 - Get row(s) in sheet1

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

Block 12 - Remove Duplicates3

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

Block 13 - Append row in sheet2

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

Block 14 - Loop Over Items1

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Block 15 - Setting Pagination

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

Block 16 - Loop for Multiple Page Search

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Block 17 - Custom Google Search API

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 18 - Flatten Output Items

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

Block 19 - Information Extraction

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

Block 20 - Remove Duplicates From Searches

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

Block 21 - Scrape Site2

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 22 - If Site scrapped

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

Block 23 - Extract Required Fields

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

Block 24 - Set All Fields

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

Showing the first 24 of 40 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Automate lead generation from Google Search & Maps to Google Sheets
Complexity advanced
Nodes 40
Categories Lead Generation
Author Intuz
Published 10 Oct 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/9449/9449.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 Automate lead generation from Google Search & Maps to Google Sheets do?

This n8n template from Intuz provides a complete solution to automate on demand lead generation. It acts as a powerful scraping agent that takes a simple chat query, scour...

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.