Researched: Sourced and summarized, not yet run end-to-end by us Lead generation

Lead generation workflow: Google Maps lead list with AI scoring (n8n)

Last checked: · Sourced and summarized; not yet run end-to-end by us. What this means

At a glance

Setup estimate
1–2 h (ESTIMATE)
Tools
Industries
General (any small business)
View source template on n8n.io (opens in new tab)

Problem

Finding and prioritizing local prospects (e.g. roofers, dentists) by hand is slow, and lists end up full of duplicates

Who it's for

An n8n lead generation workflow for anyone who sells to local businesses: agencies, B2B service providers and suppliers that prospect roofers, dentists, HVAC contractors and the like. The trigger: you need a fresh, ranked list of businesses of one type in one area, without copying them out of Google Maps by hand or re-adding ones you already have. You type a request such as 'plumbers in Austin, 50' into a chat and get a scored list back, saved to a Google Sheet.

Skip it if you need email addresses or decision-maker names: the template switches the scraper's email enrichment and social profiles off and saves only public listing data (name, category, address, phone, website, rating, reviews, Maps link, description). Also skip it if your use of scraped Google Maps data isn't allowed under the terms that apply to you.

Tools and what each does

n8n Chat Trigger
Receives your plain-language search request.
Google Gemini API via HTTP Request (gemini-3.1-flash-lite in the template)
Called twice: first to turn the request into business_type, location, max_results (default 20, capped at 50 by the prompt) and output_mode; then to score each lead 0–100 and add a one-line reason.
Apify (Google Maps actor WnMxbsRLNbPeYL6ge, 'Google Maps Email Extractor' by lukaskrivka)
Runs synchronously via run-sync-get-dataset-items and returns the matching places. The detail page is scraped only when output_mode is full_details.
n8n Set, Remove Duplicates, Aggregate, Split Out and Code nodes
Keep ten lead fields, drop duplicate placeIds within the run, batch leads for scoring, compare against the sheet and format the chat reply.
Google Sheets (service account)
Looks up each scored lead's placeId, then appends or updates rows matched on placeId.

Browse by tool: n8n, Apify, Google Gemini, Google Sheets

Steps

  1. You send a chat message like 'dentists in Leeds, 30' or 'just the phone numbers for roofers in Denver'.
  2. Gemini returns the search parameters as JSON; n8n builds the Apify input from them (English, closed places included, enrichment and social profiles off).
  3. Apify scrapes Google Maps and returns the places; n8n keeps placeId, title, category, address, phone, website, rating, review count, Maps URL and description.
  4. Duplicates inside the batch are removed by placeId and the remaining leads are merged into one list.
  5. Gemini scores every lead with the template's rubric: +20 each for a phone number, a website, a rating of 4.0 or more, 20 or more reviews, and a category that matches the request. It returns the list sorted by score.
  6. Each lead's placeId is looked up in your sheet; leads already saved are filtered out.
  7. New leads are appended (or updated) in the sheet, and the chat gets a numbered list: phone only in contacts mode, or score, contact details, rating, address, Maps link and the score reason in full mode.

Before you start

  • A Google Gemini API key added in n8n as a 'Google Gemini (PaLM) API' credential, used by both HTTP Request nodes.
  • An Apify account and API token, added as an HTTP Header Auth credential. The actor is pay-per-event, billed per scraped place; check the actor's Apify page for the current price. Your cost per run is UNKNOWN.
  • A Google Cloud service account with access to your sheet (share the sheet with the service account's email), and a sheet whose header row has placeId, title, category, address, phone, website, rating, reviewsCount, mapsUrl, description, score and score_reason.
  • Replace the template's spreadsheet ID and tab, which point at the author's 'HVAC Contractors Data' sheet.
  • Setup estimate: 1–2 h (ESTIMATE).

What can go wrong

Apify usage is billed separately (cost per run UNKNOWN), and you need a Google Gemini API key. Scraping Google Maps may be limited by Google's and Apify's terms; review them before use.

  • ModelThe template calls gemini-3.1-flash-lite in two hard-coded URLs. Google's deprecations page lists it for shutdown no sooner than May 7, 2027; to use a current model, change both URLs to gemini-3.6-flash.
  • Silent failureIf every scraped lead is already in your sheet, the comparison step outputs nothing, so the save and reply steps never run and the chat likely gets no answer at all. Add a fallback reply for 'no new leads'.
  • ReliabilityThe score is a simple sum, but the template asks the AI to do the arithmetic and to echo every lead back unchanged. A model can mis-add, drop leads or alter a placeId (which breaks de-duplication). Computing the rubric in a Code node is more predictable; keep the AI only for the reason line, if at all.
  • Rate limitThe sheet lookup runs once per lead, so a 50-lead search makes about 50 read requests. Google's Sheets API allows 60 reads per minute per user per project (a service account counts as one user), so large or back-to-back searches can hit 429 errors. Reading the sheet once and comparing in code avoids this.
  • ReliabilityApify's synchronous endpoint returns a 408 timeout if the actor run exceeds 300 seconds, and the template's HTTP timeout is also 300 seconds. Big searches with full_details can fail; use Apify's async run plus a webhook for large lists.
  • CostEach search costs Apify usage plus two Gemini calls. The 50-lead cap lives only in the prompt, so set maxCrawledPlacesPerSearch to a hard limit in the Apify input as well.
  • LegalScraping Google Maps may be limited by Google's and Apify's terms; review them before use. Phone numbers of sole traders can be personal data in some places, so check the rules where you prospect before cold-calling.

How to adapt it

  • Change the scoring rubric to what matters for your offer, for example 'no website' as a plus if you sell websites.
  • Turn on the actor's email enrichment or social profiles if you need them (more paid events per place), and add those columns to the sheet.
  • Swap the chat trigger for a Form Trigger or a schedule with a fixed list of searches.
  • Send new leads straight to your CRM instead of, or as well as, the sheet.
  • For non-English markets, change the Apify input's language from 'en'.

Sources we checked

Status
Researched: Sourced and summarized, not yet run end-to-end by us
Last checked
Details checked

Setup estimates are rough guesses for someone comfortable with the tools who already has the accounts and API keys. Real time is unknown until tested.

Practical AI workflows for small businesses, every Tuesday

A few workflows each issue for lead follow-up, CRM, proposals, onboarding and support, each labeled Researched or Tested.

We'll email you a link to confirm. Unsubscribe in one click. Privacy policy.

Why trust it: every entry links its source and caveats, and nothing is called Tested until we publish the logs. Our method.

More lead generation workflows