Automated Lead Generation using Google Maps Data and Google Sheets - n8n Workflow

Use this powerful n8n workflow template to automate zip code-based business lead generation from Google Maps data. Extract, deduplicate, and save sales leads directly to Google Sheets using a custom n8n node integration.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Sales Development Representatives (SDRs) needing targeted geographical lead lists.
Marketing agencies running local campaigns.
Data analysts requiring structured business data extracted from web APIs.
Users looking for advanced, reliable n8n templates for web scraping and data pipeline creation.

Overview

Manual business lead generation across specific geographical areas (zip codes) and niche categories is time-consuming and error-prone. This specialized n8n workflow solves this challenge by creating a robust, scheduled data pipeline.

It leverages Google Sheets as a configuration source—allowing users to easily manage target zip codes and categories—and then uses an HTTP Request n8n node to interface with the Google Maps Places API (or similar service). After fetching the data, the n8n workflow processes, cleans, and deduplicates the results before appending them back to another designated Google Sheet. Furthermore, it incorporates sophisticated retry and exponential backoff logic, ensuring the pipeline is resilient to temporary API failures, making this one of the most reliable n8n templates for continuous lead flow.

How it Works

This automation operates on a highly structured loop system driven by a time-based n8n trigger:


  1. Scheduled Activation: The process begins with the Schedule n8n trigger, initiating the automation on a set interval.

  2. Input Configuration: The workflow first uses the Google Sheets n8n node to retrieve all targeted zip codes and then retrieves the list of search categories/subcategories from separate sheets.

  3. Nested Iteration: The workflow employs two Split In Batches n8n node components: one to iterate over each individual zip code (Loop) and a second to iterate over each subcategory (Loop Subcats) combined with that zip code.

  4. API Execution: The Set zip n8n node dynamically constructs the search query. This query is then executed by the Google Map API HTTP Request n8n node, retrieving raw location data.

  5. Data Transformation: An If n8n node checks for successful API returns. If data exists, the Place Code n8n node transforms the raw JSON response into structured lead data (e.g., business name, address, contact). The Set Place n8n node finalizes the structure.

  6. Deduplication & Storage: The Remove Duplicates n8n node ensures only unique leads are passed. The Add rows in Google Sheets n8n node then commits the new leads to the master lead sheet.

  7. Resilience and Retries: If the Google Sheets insertion fails, the n8n workflow utilizes an Exponential Backoff and Wait n8n node sequence. A Check Max Retries n8n node ensures the process attempts reconnection before failing. A similar retry mechanism is implemented for updating the status of the processed zip/category combination.

  8. Status Update: Upon successful data retrieval and storage, the workflow updates the status of the processed zip/category in the sheet using the Update Status to Success n8n node, ensuring data integrity and progress tracking for the overall n8n workflow.

  9. Notifications: Critical failures or successful completion can trigger notifications via Telegram, Discord, and Rapiwa (WhatsApp integration), routed through the Do nothing n8n node path after retries fail.

Installation Guide

To set up this powerful n8n workflow using these n8n templates, follow these steps:


  1. Import the n8n Workflow: Copy the provided JSON code and import it into your n8n instance via the Workflows section (New > Import from JSON).

  2. Configure Credentials: You will need to set up credentials for the following services:

Google Sheets: Essential for reading zip codes/categories and writing extracted leads. Ensure the credential has read/write access to your configuration and output sheets.
Google Maps API: Set up the API key and endpoint configuration within the Google Map API HTTP Request n8n node.
* Notification Services (Optional): Configure Telegram, Discord, and Rapiwa (if used) credentials if you wish to receive automated status updates.

  1. Update Node Parameters: Navigate to the Google Sheets n8n node instances (Get All Zip Code, Get Subcategory form sheet, Add rows in Google Sheets) and update the 'Spreadsheet ID' and 'Sheet Name' parameters to match your setup.

  2. Customize Search: Adjust the search query parameters in the Set zip n8n node and the Google Map API n8n node to refine your lead criteria (e.g., search radius, language, specific keywords).

  3. Activate: Set the n8n trigger (Schedule) to your desired frequency and activate the n8n workflow.

Node Details

Schedule (n8n trigger): The starting n8n trigger. Defines the frequency at which the lead generation process runs (e.g., daily, weekly).
Google Sheets (Get All Zip Code / Get Subcategory form sheet): These n8n nodes fetch the configuration data (zip codes and categories) that define the scope of the lead search.
Split In Batches (Loop / Loop Subcats): Core flow control n8n nodes responsible for iterating through the list of zip codes and then iterating through the categories for each zip code, ensuring that the Google Map API is called sequentially for each combination.
Set (Set zip): Prepares the search payload by combining the current zip code and category into a single, structured input for the API call.
HTTP Request (Google Map API): This crucial n8n node executes the external API call to Google Maps, performing the actual data extraction based on the dynamically generated query.
Code (Place): A custom JavaScript n8n node designed to parse the potentially complex JSON response from the Google Maps API, extracting and flattening the necessary lead details.
Remove Duplicates: An essential utility n8n node that cleans the extracted batch of leads before insertion into the database, maintaining data quality.
Google Sheets (Add rows in Google Sheets): The primary output n8n node, responsible for appending the newly verified and deduplicated leads to the specified target spreadsheet.


  • Code / Wait (Exponential Backoff, Wait): Paired n8n nodes used in conjunction with 'If' logic to implement resilient error handling and retry mechanisms using an exponential backoff strategy, critical for stable, long-running n8n templates.

Related n8n Workflows

Paid

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

SpaGreen Creative is a leading software company specializing in SaaS solutions, AI automation, and Laravel/Vue.js development. With 800+ eCommerce platforms and 8,000+ global clients, we deliver powerful tools for OTT, CRM, ERP, and WhatsApp marketing. We combine innovation and tech to build scalable digital products.

Featured*