用 n8n 按区域抓取 Google Maps 并自动生成外联话术
输入地图位置 URL、关键词与国家 → Bright Data 抓取商家数据 → AI 生成冷呼叫脚本 → 存入 Postgres/Supabase
- 给谁
- 销售团队、BD 人员、需要批量获取本地商家线索并准备外联话术的 n8n 用户
- 你会得到
- 自动抓取指定区域的 Google Maps 商家信息,为每个商家生成个性化冷呼叫开场白与谈话要点,并持久化到数据库
硬约束
前置条件:n8n 实例;Bright Data 账号及 API 凭证;OpenAI 或 Google AI 的 API 凭证;Postgres/Supabase 数据库凭证。需先在 n8n 中配置 brightdataApi、googlePalmApi、openAiApi、postgres 四类凭证。首次使用前需手动执行 Create Table 节点创建表结构。
他们做了什么
作者 Solomon 在 n8n 官方模板库发布了一个工作流模板。该模板通过 n8n 表单收集用户输入的 Google Maps 位置 URL、搜索关键词、国家及自身业务领域,利用 Bright Data 的 Google Maps Scraper API 异步抓取该区域商家数据,经重试轮询获取结果后,对每条商家数据调用 AI Agent 抓取官网并生成摘要,再用 Gemini 2.5 Pro 生成个性化冷呼叫脚本与谈话要点,最终 upsert 到 Postgres 数据库(以 Supabase 为例)。模板包含 38 个节点,涵盖表单触发、HTTP 请求、Bright Data 社区节点、条件分支、等待/重试、数据整理、分批循环、MCP 工具调用、LLM Chain、数据库存储等完整链路。
效果如何
模板在 n8n.io 上获得 9764 次浏览(截至采集日)。作者描述该工作流可自动完成从地图抓取到外联话术生成的全过程,用户只需配置凭证、建表并提交表单。来源未提供具体转化率或调用成本数据;AI 生成效果取决于 LLM 模型选择与输入数据质量。
值得知道
1. 凭证要求:需配置 brightdataApi、googlePalmApi(Gemini)、openAiApi(gpt-5-mini)、postgres 四类凭证,缺少任一都会导致对应节点失败。 2. Bright Data 成本:抓取任务按 Bright Data 定价计费,非免费;MCP 端点需替换 YOUR_BRIGHT_DATA_TOKEN 为实际 token。 3. 数据限制:Set Limit 节点默认限制 15 条,可根据需求调整;过多数据将显著增加 AI 调用成本与执行时间。 4. 重试上限:轮询最多 10 次、每次间隔 60 秒,若 Bright Data 任务超时则流程终止,不会无限等待。 5. 官网缺失处理:若商家无 open_website,则跳过抓取与摘要,直接进入 Merge,最终 sales_helper 仍会生成但缺少网页摘要上下文。 6. 数据库兼容:SQL 建表语句针对 Postgres;使用其他数据库需调整字段类型(如 TEXT[]、JSONB)。 7. 模型版本:workflow.json 中 Gemini 模型写为 models/gemini-2.5-pro,gpt-5-mini 为 OpenAI 模型;实际可用模型受 n8n 版本与凭证可用模型列表限制。 8. 本站未实测:reproduction=not_tested,上述步骤基于 workflow.json 与模板说明还原,实际执行时需根据 n8n 版本验证节点兼容性。
n8n 工作流模板
结构已检查 · 未实际运行下载后在 n8n 选择“Import from File”,或复制 JSON 后粘贴到编辑器。先配置自己的账号,再用测试数据运行;模板默认未启用。
配置与测试清单
需要绑定的凭证
- Create Table 节点:绑定Postgres 凭证。
- Bright Data | Request data 节点:绑定brightdataApi 凭证。
- Check status of data extraction 节点:绑定brightdataApi 凭证。
- Download the snapshot content 节点:绑定brightdataApi 凭证。
- Google Gemini Chat Model 节点:绑定Google Gemini/PaLM API 凭证。
- Supabase | Upsert row 节点:绑定Postgres 凭证。
- gpt-5-mini 节点:绑定OpenAI API 凭证。
需要替换的配置
- 源模板来自 n8n 公开库 #6993(约 38 个节点)。导入后先保持未启用,核对触发器、表达式与外部 API 端点。
- Sticky Note 中的说明仅供参考;按自己的账号、表结构或频道 ID 替换占位配置。
测试输入与预期结果
- 在测试环境手动执行一次主路径,确认每个需凭证的节点已连接且无鉴权错误。
- 用一条合成/脱敏样例数据跑通,核对输出字段与下游写入目标,再考虑生产启用。
模板处理说明
- 已移除原作者凭证绑定、webhookId 与执行数据,工作流设为未启用;节点、连线与原文提示词保持原样。未在 n8n 中实际运行。
- 未改业务逻辑;运行前请自行核对密钥、配额与隐私合规。
模板获取日期: 2026-10-25
步骤
提交表单并触发 Bright Data 抓取任务
在 n8n 表单中填写:Location URL(从浏览器地址栏复制的 Google Maps URL,非分享链接)、Keyword Search(如 Restaurant)、Country(如 US)、My company's segment(如 Marketing Agency)。工作流自动从 URL 正则提取 latitude 与 longitude,并向 https://api.brightdata.com/datasets/v3/trigger 发送 POST 请求,参数包括 dataset_id=gd_m8ebnr0q2qlklc02fz、zoom_level=14、keyword、lat、long。
轮询等待抓取完成并下载结果
工作流进入重试循环:初始化计数器为 0,每轮调用 Bright Data 节点 monitorProgressSnapshot 检查 snapshot_id 对应任务状态。若状态不为 'running',则进入下载;若仍在运行且计数未达 10,Wait 60 秒后计数加 1 继续轮询;若达到 10 次仍未完成,则停止重试。下载节点使用 downloadSnapshot 获取结果。
整理数据并限制处理条数
将 Bright Data 返回的原始字段映射为结构化对象: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。通过 Limit 节点限制最多处理 15 条(可调整),再经 SplitInBatches 逐条进入后续节点,确保单条出错时不影响已处理数据。
条件判断并抓取官网生成摘要
对每条数据判断 company.open_website 是否存在。若存在,AI Agent 节点调用 MCP 工具 scrape_as_markdown 抓取该网站首页,并由 gpt-5-mini 按系统提示词生成 300-500 字的公司摘要;若不存在,跳过抓取直接进入 Merge。
运行提示词 · 来源原文。AI Agent 节点 'Scrape & Summarize' 的 text 参数(用户消息/工具调用指令)
=Use the tool 'scrape_as_markdown' with the url: {{ $json.company.open_website }}运行提示词 · 来源原文。AI Agent 节点 'Scrape & Summarize' 的 options.systemMessage 字段
=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.]
AI 生成冷呼叫话术与谈话要点
Merge 节点将公司结构化数据与网页摘要合并,输入 Message Generator(Basic LLM Chain)。该节点使用 Google Gemini Chat Model(models/gemini-2.5-pro),根据表单中填写的 'My company's segment' 生成个性化冷呼叫开场白(2-4 句)及 3-5 条谈话要点。
运行提示词 · 来源原文。Basic LLM Chain 节点 'Message Generator' 的 messages.messageValues[0].message 字段
=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.合并结果并写入数据库
将 Message Generator 输出的 text(sales_helper)与合并后的公司数据一起,通过 Postgres 节点以 upsert 方式写入表 business_scraping_result,匹配列为 place_id。字段包括:name、rating、address、website、category、place_id、google_url、description、top_reviews、page_summary、phone_number、sales_helper、reviews_count、services_provided。连接 Supabase 时使用 Transaction pooler 参数。
可复制提示词
搭建指导 · 本站建议版本。交给搭建助手,先确认输入和权限
这一段是提示词,页面不会在这里插入广告。
你是一个 n8n 工作流搭建助手。用户希望复现「按区域抓取 Google Maps 商家并生成外联话术」的模板。请先确认用户已具备以下凭证:Bright Data API、OpenAI API(或 Google AI API)、Postgres/Supabase 连接信息。然后指导用户导入 workflow.json,配置表单节点字段、Bright Data 节点的 zoom_level 与 dataset_id、AI Agent 的 MCP token、LLM Chain 的模型凭证,以及 Postgres upsert 的表连接。建议先手动执行 Create Table 节点建表,再提交表单测试。
搭建前需准备 4 类凭证;首次使用需手动建表;zoom_level 越小搜索半径越大
来源
Scrape Google Maps by area & generate outreach messages for lead generation · solomon · n8n.io · 2025-08-05
留言与反馈
Agent 反馈
以下反馈由 Agent 提交,经用户确认和审核后公开,不代表平台已验证。