GeminiSalesOutreachAI score · PendingAI-assisted edit · no obvious prompt-injection riskn8n.io

Scrape Google Maps by area & generate outreach messages with n8n

Input a Maps location URL, keyword, and country → Bright Data scrapes local businesses → AI generates cold-call scripts → Store in Postgres/Supabase

Some experienceStepsWorkflowPromptTip
Who
Sales teams, BD reps, and n8n users who need bulk local-lead extraction with AI-generated outreach scripts
You get
Automatically scrape Google Maps business listings for a target area, generate a personalized cold-call opener and talking points per lead, and persist everything to a database
You need
n8n · bright-data · gemini · postgres · supabase

Constraints

Prerequisites: an n8n instance; a Bright Data account with API credentials; an OpenAI or Google AI API key; Postgres/Supabase database credentials. Configure four credential types in n8n: brightdataApi, googlePalmApi, openAiApi, and postgres. Run the Create Table node manually once before first use.

What they did

Author Solomon published an n8n template on the official n8n.io template library. The template collects user input via an n8n form (Google Maps location URL, search keyword, country, and the user's business segment), triggers an asynchronous Google Maps scrape via the Bright Data API, polls with retry logic until the job completes, then processes each business record: an AI Agent (gpt-5-mini) uses the Bright Data MCP scrape_as_markdown tool to fetch and summarize the company's homepage, and a Basic LLM Chain (Gemini 2.5 Pro) generates a personalized cold-call opener and talking points. Finally, the enriched record is upserted into a Postgres table (demonstrated with Supabase). The template contains 38 nodes covering form trigger, HTTP request, Bright Data community nodes, conditional branching, wait/retry loops, data mapping, batch splitting, MCP tool calls, LLM chains, and database storage.

How it went

The template has 9,764 views on n8n.io as of the crawl date. The author states the workflow automates the full pipeline from map scraping to outreach script generation; users only need to configure credentials, create the table, and submit the form. No specific conversion rates or cost figures are provided by the source; AI output quality depends on the LLM model selected and the richness of input data.

Worth knowing

1. Credentials required: brightdataApi, googlePalmApi (Gemini), openAiApi (gpt-5-mini), and postgres must all be configured; missing any will fail the corresponding node. 2. Bright Data costs: scraping jobs are billed per Bright Data pricing; the MCP endpoint requires replacing YOUR_BRIGHT_DATA_TOKEN with a real token. 3. Data volume: the Set Limit node defaults to 15 items; adjust as needed, but larger volumes increase AI call costs and execution time significantly. 4. Retry cap: polling retries up to 10 times with 60-second waits; if the Bright Data job exceeds this, the workflow stops and does not wait indefinitely. 5. Missing websites: if a business has no open_website, scraping and summarization are skipped and the record proceeds directly to Merge; sales_helper is still generated but without the web-summary context. 6. Database compatibility: the provided CREATE TABLE SQL targets Postgres; other databases may need type adjustments (e.g., TEXT[], JSONB). 7. Model versions: the workflow specifies models/gemini-2.5-pro and gpt-5-mini; actual availability depends on your n8n version and credential model list. 8. Not tested by this site: reproduction=not_tested; steps are reconstructed from workflow.json and template documentation; verify node compatibility with your n8n version before production use.

n8n workflow template

Structure checked · Not run-tested

Use “Import from File” in n8n, or copy the JSON and paste it into the editor. Connect your own accounts, then try test data. The template is inactive by default.

Setup and test checklist

Credentials to connect

  • Create Table node: connect Postgres credentials.
  • Bright Data | Request data node: connect brightdataApi credentials.
  • Check status of data extraction node: connect brightdataApi credentials.
  • Download the snapshot content node: connect brightdataApi credentials.
  • Google Gemini Chat Model node: connect Google Gemini/PaLM API credentials.
  • Supabase | Upsert row node: connect Postgres credentials.
  • gpt-5-mini node: connect OpenAI API credentials.

Configuration to replace

  • Source template is n8n public workflow #6993 (~38 nodes). Keep inactive after import; verify triggers, expressions and external API endpoints.
  • Sticky-note guidance is informational; replace placeholders with your own accounts, sheet schemas or channel IDs.

Test input and expected output

  • Manually run the main path once in a test workspace and confirm credentialed nodes authenticate without errors.
  • Drive one synthetic/redacted sample through and check output fields and downstream writes before enabling in production.

Template changes

  • Author credential bindings, webhookId and execution data are removed; the workflow is inactive. Nodes, connections and original prompts are preserved. Not run-tested in n8n.
  • No business-logic edits; verify keys, quotas and privacy compliance before use.

Template retrieved: 2026-10-25

Steps

  1. Submit the form and trigger the Bright Data scrape job

    Fill the n8n form: Location URL (copy from the browser address bar, NOT the Share feature), Keyword Search (e.g., Restaurant), Country (e.g., US), and My company's segment (e.g., Marketing Agency). The workflow extracts latitude and longitude via regex from the URL, then POSTs to https://api.brightdata.com/datasets/v3/trigger with dataset_id=gd_m8ebnr0q2qlklc02fz, zoom_level=14, keyword, lat, and long.

  2. Poll until the scrape finishes and download the snapshot

    The workflow enters a retry loop: initialize a counter to 0, then call the Bright Data node monitorProgressSnapshot for the snapshot_id. If status is not 'running', proceed to download; if still running and the counter is below 10, Wait 60 s, increment the counter, and retry; if the limit of 10 is reached, stop. The download node uses downloadSnapshot to fetch results.

  3. Organize data and limit batch size

    Map raw Bright Data fields into a structured object: place_id, company.google_url, company.name, company.category, company.address, company.description, company.reviews_count, company.rating, company.services_provided, company.open_website, company.phone_number, company.top_reviews. The Limit node caps processing at 15 items (adjustable). SplitInBatches feeds items one-by-one so that an error on one item does not block previously processed items.

  4. Check for a website, scrape it, and summarize

    For each item, check whether company.open_website exists. If it does, the AI Agent node calls the MCP tool scrape_as_markdown to fetch the homepage, then uses gpt-5-mini with the system prompt to produce a 300–500-word company summary. If no website exists, skip scraping and go straight to Merge.

    Execution prompt · Source text。AI Agent node 'Scrape & Summarize' text parameter (user message / tool-call instruction)

    =Use the tool 'scrape_as_markdown' with the url:
    {{ $json.company.open_website }}

    Execution prompt · Source text。AI Agent node 'Scrape & Summarize' options.systemMessage field

    =You are a web-scraping AI agent equipped with the tool 'scrape_as_markdown'.
    
    # TASK
    Scrape the homepage of the provided website and generate a structured summary of the company based on the main content.
    
    ## OBJECTIVES
    1. Scrape.
    2. Extract only the core content of the page.
    3. Identify key information:
       - Company mission or vision
       - Products or services offered
       - Target audience or market
       - Key messaging, branding, or positioning
       - Any highlighted achievements, updates, or announcements
    
    ## CONSTRAINTS
    - Prioritize meaningful textual content over visuals or layout elements.
    - Ensure clarity and neutrality in the summary.
    
    # OUTPUT REQUIREMENTS
    Return a summary of 300-500 words in the following format:
    [Company Name]:
    
    [Summary of company in 300-500 words, clearly structured and written in neutral, informative language.]
  5. Generate the cold-call script and talking points with AI

    The Merge node combines the structured company data with the page summary, then passes it to the Message Generator (Basic LLM Chain). This node uses the Google Gemini Chat Model (models/gemini-2.5-pro) and the form-submitted 'My company's segment' to generate a personalized cold-call opener (2–4 sentences) and 3–5 talking points.

    Execution prompt · Source text。Basic LLM Chain node 'Message Generator' messages.messageValues[0].message field

    =You are a business development assistant helping an entrepreneur prepare for a cold call to a business lead.
    
    Take into account that my company segment is: {{ $('On form submission').first().json['My company\'s segment'] }}
    
    # TASK
    You will receive structured data about a business, including basic info, services, reviews, and contact details.
    
    Your job is to generate:
    1. A short cold call opening message the entrepreneur can use to start the conversation.
    2. A list of supportive talking points or insights the entrepreneur can use during the call to sound informed and build rapport.
    
    # OUTPUT STRUCTURE
    1. Opening Message (Spoken Script):
    - 2–4 sentences.
    - Friendly, confident, respectful tone.
    - Show that the caller is familiar with the business.
    - Mention something specific (e.g. high rating, food quality, atmosphere, community praise).
    - Introduce the caller’s intention (e.g. connect, collaborate, learn more).
    
    2. Call Support Notes (Bullet List):
    - Provide 3–5 relevant talking points about the business based on reviews, services, and offerings.
    - Suggest areas the entrepreneur can mention or ask about (e.g. “Your place seems popular with tourists and locals alike — how do you approach that balance?”)
    - Avoid quoting reviews verbatim — instead, summarize sentiment or praise.
    
    # INSTRUCTIONS
    - Generate a personalized cold call opening message
    - Generate a list of insightful, natural talking points to help the entrepreneur carry the conversation confidently
    
    # GUIDELINES
    - Output only the results, without any intro or outro text.
  6. Merge results and upsert into the database

    Pass the Message Generator output text (sales_helper) together with the merged company data into the Postgres node, which upserts into table business_scraping_result on matching column place_id. Fields written: name, rating, address, website, category, place_id, google_url, description, top_reviews, page_summary, phone_number, sales_helper, reviews_count, services_provided. Connect to Supabase using the Transaction pooler parameters.

Prompt you can copy

Setup guidance · Editorial suggestion。Hand to a setup assistant; confirm inputs and permissions first

This block is the prompt. Ads are never placed here.

You are an n8n workflow setup assistant. The user wants to replicate the 'Scrape Google Maps by area & generate outreach messages' template. First confirm the user has credentials for: Bright Data API, OpenAI API (or Google AI API), and Postgres/Supabase connection details. Then guide them to import workflow.json, configure the form node fields, the Bright Data node's zoom_level and dataset_id, the AI Agent's MCP token, the LLM Chain model credentials, and the Postgres upsert table connection. Advise running the Create Table node manually before submitting the form for a test.

Four credential types required; run Create Table manually before first use; lower zoom_level = larger search radius

Source

Scrape Google Maps by area & generate outreach messages for lead generation · solomon · n8n.io · 2025-08-05

Comments & feedback

Tried this method? Share results, problems or improvements. Comments appear after moderation. Please avoid sensitive information.

Loading…

    Related