Skip to main content

Generate leads with Google Maps

Workflow preview

Workflow preview
100%
Generate leads with Google Maps 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 workflow leverages n8n to perform automated Google Maps API queries and manage data efficiently in Google Sheets. It's designed to extract specific location data based on a given list of ZIP c...

Best for

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

Tools used

n8n-nodes-base.manualtrigger, n8n-nodes-base.scheduletrigger, n8n-nodes-base.executeworkflowtrigger, n8n-nodes-base.if, n8n-nodes-base.stopanderror, n8n-nodes-base.httprequest, n8n-nodes-base.googlesheets, n8n-nodes-base.set

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Generate leads with Google Maps
Workflow name
Generate leads with Google Maps

This workflow leverages n8n to perform automated Google Maps API queries and manage data efficiently in Google Sheets. It's designed to extract specific location data based on a given list of ZIP codes and categories.


Features

  • Queries the Google Maps API for location data using predefined ZIP codes and subcategories.
  • Filters, de-duplicates, and organizes data into structured rows in Google Sheets.
  • Implements exponential backoff retries to handle API rate limits.
  • Logs and updates statuses directly in Google Sheets for easy tracking.

Prerequisites

  1. Google OAuth Credentials: A configured Google Cloud project for Google Maps API and Sheets API access.
  2. Google Sheets: A sheet with ZIP codes and categories defined (e.g., "AZ Zips").
  3. n8n Setup: A running instance of n8n with credentials configured for Google OAuth.

Setup Instructions

1. Prepare Google Sheets

  • Add the ZIP codes to the "AZ Zips" sheet.
  • Define subcategories in another sheet (e.g., "Google Maps Categories").
  • Provide the sheet's URL in the Settings node of the workflow.

2. Configure API Access

  • Set up Google OAuth credentials for Maps and Sheets APIs in n8n.
  • Ensure your API key has access to the places.searchText endpoint.

3. Workflow Customization

  • Modify textQuery parameters in the GMaps API node to match your query needs.
  • Adjust trigger intervals as required (e.g., manual or scheduled execution).

4. Run the Workflow

  • Execute the workflow manually or schedule periodic runs to keep your data updated.

Notes

  • This workflow includes robust error handling to retry failed API calls with exponential backoff.
  • All data is organized and logged directly in Google Sheets for easy reference and updates.

For more information or issues, feel free to reach out!

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 clicking "Execute Workflow"

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

Block 2 - Run workflow every hours

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

Block 3 - Execute Workflow Trigger

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

Block 4 - Check Max Retries1

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

Block 5 - Stop and Error1

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

Block 6 - GMaps API

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

Block 7 - Update Status to Success

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

Block 8 - Add rows in Google Sheets

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

Block 9 - Set Row Number

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

Block 10 - Set Zip

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

Block 11 - Set Place ID

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

Block 12 - Exponential Backoff

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

Block 13 - Remove Duplicates

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

Block 14 - Wait

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

Block 15 - Check Max Retries

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

Block 16 - Stop and Error

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

Block 17 - Exponential Backoff1

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

Block 18 - Wait1

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

Block 19 - Settings

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

Block 20 - GS - Get Subcategory

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

Block 21 - Subcategory

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

Block 22 - GS - Get Zip Codes

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

Block 23 - Place Array

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

Block 24 - Loop Zips

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

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

3. Summary Table

Workflow Generate leads with Google Maps
Complexity advanced
Nodes 42
Categories Lead Generation
Author Alex Kim
Published 04 Dec 2024

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/2605/2605.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 Generate leads with Google Maps do?

This workflow leverages n8n to perform automated Google Maps API queries and manage data efficiently in Google Sheets. It's designed to extract specific location data based on a given list of ZIP c...

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.