Use this robust n8n workflow to automate lead generation. It scrapes Google Maps Places API data, handles rate limits with exponential backoff, and saves detailed business information directly to Google Sheets. A crucial n8n templates for marketers.
Download this n8n workflow template and start using it instantly.
Markdown-formatted text defining the user persona.
Marketing Agencies and Lead Researchers: Individuals needing high volumes of local business data.
Automation Specialists: Users looking for advanced examples of robust looping, API handling, and error management within an n8n workflow.
SaaS Sales Teams: Teams aiming to populate their CRM with verified geographical leads.
Data Engineers: Anyone requiring a reliable, scheduled data extraction solution built using n8n templates.
Generating high-quality, localized leads often involves repetitive manual searches. This n8n workflow solves this problem by creating a fully autonomous system for mass data extraction from Google Maps. It reads configuration (zip codes and business categories) from a Google Sheet, queries the Google Places API using a custom search query (e.g., 'plumber 90210'), extracts rich business details, and then cleans and imports that data back into a designated 'Results' Google Sheet.
A key feature of this n8n automation is its built-in API error handling. Since Google APIs frequently impose strict rate limits, the n8n node structure includes custom JavaScript for Exponential Backoff and a Wait n8n node. This mechanism ensures that if an API limit is hit, the workflow pauses, increases the delay time exponentially, and retries, preventing job failure and maximizing data throughput. This robust n8n template ensures reliable lead generation.
This n8n workflow operates using two nested loops based on inputs from a configuration Google Sheet:
Filter n8n node to ensure only un-scraped zip codes are processed and applies a Limit to prevent excessively long executions.Loop Subcats n8n node iterates through these.HTTP Request n8n node (labeled 'GMaps API') to query the Google Places API. The query combines the current Subcategory and Zip Code. It requests specific fields like phone number, website, rating, and address, ensuring comprehensive lead data.Code n8n node ('Place Array'). This transforms the nested JSON structure so that each individual place becomes a separate item for processing by subsequent n8n nodes.place.id) are removed. The enriched lead data is then inserted or updated into the primary 'Results' Google Sheet using the Add rows in Google Sheets n8n node.Update Status to Success n8n node marks the zip code in the source sheet as 'scraped', ensuring the n8n workflow does not process it again.Markdown-formatted text detailing installation and setup.
Settings Node: Update the Settings n8n node with your specific Google Sheet URL (gs_url), the sheet name containing your categories (catSheet), and the sheet name containing the zip codes to process (sheet).Settings node (e.g., 'AZ Zips' and 'Google Maps Categories'). The zip code sheet must have columns like zip and status.Markdown-formatted text detailing node specifics.
When clicking "Execute Workflow" (Manual Trigger): The starting n8n trigger used to launch the automation manually for testing or initial runs. Another option, Run workflow every hours, is provided as an alternative scheduled n8n trigger.
Settings (Set n8n node): Essential configuration point. Stores the primary Google Sheets document URL (gsurl), the category sheet name (catSheet), and the zip code sheet name (sheet).
GMaps API (HTTP Request n8n node): The core API interaction. Uses a POST request to places.googleapis.com/v1/places:searchText. Crucially, it utilizes the X-Goog-FieldMask header to specify exactly which fields (phone, website, rating, coordinates) should be returned, optimizing API usage and performance in this n8n workflow.
Place Array (Code n8n node): This custom n8n node script is vital for flattening the nested JSON response from the Google Maps API, ensuring each scraped location is handled as an independent item in the n8n workflow stream.
Add rows in Google Sheets (Google Sheets n8n node): Performs the final lead data storage. Uses the 'Append Or Update' operation to write extracted data points like title, phone, website, and gpscoordinates to the 'Results' sheet.
Exponential Backoff (Code n8n node): Implements advanced error handling. This specific n8n node calculates a retry count and exponentially increasing wait time, crucial for surviving frequent Google API rate limits. It is linked directly to a Wait n8n node to pause the n8n workflow before retrying failed Google Sheets operations.
Use this powerful n8n workflow to instantly qualify leads submitted via Tally forms using advanced AI models (Qwen, Gemini) and send structured reports directly to Gmail. Automate sales intelligence.

Use this efficient n8n workflow to automatically generate lead magnet ideas from Google Sheets using a RapidAPI AI service. Scale your content creation pipeline with pre-built n8n templates.

Use this n8n workflow to instantly generate language flashcards using GPT-4o-mini from Telegram input. Store structured data in Google Sheets for easy import into Anki.

Generate detailed Agile Lessons Learned reports automatically when a Jira Epic is marked 'Done'. This advanced n8n workflow uses OpenAI and Langchain n8n nodes to synthesize comments and descriptions into structured Markdown reports for immediate publishing in Google Docs.








































