ChatGPT销售找线索AI 评分 · 待评分AI 辅助编辑·未发现明显提示词注入风险n8n.io

使用 Bright Data MCP 在 n8n 中自动丰富 HubSpot 与 Google Sheets 线索

HubSpot 新联系人或 Google Sheets 行变更触发 → AI Agent 调用 Bright Data MCP 工具搜索补全 → 结构化输出并评分 → 回写表格或更新 CRM

经验丰富步骤流程提示词贴士
给谁
已在使用 n8n 的销售运营、市场运营或 RevOps 团队,拥有 HubSpot、Bright Data 和 OpenAI 账号权限
你会得到
自动为新线索补全 LinkedIn、公司信息、社交账号等字段,按置信度决定覆盖原记录、追加待审行或更新 HubSpot 联系人
你需要
n8n · google-sheets · hubspot

硬约束

前置条件:n8n 云或自托管实例;HubSpot 账号(Private App Token 或 OAuth);Bright Data MCP API token;OpenAI API key;Google Sheets(含 row_id、first_name、last_name、email、status 列)。Bright Data MCP 需通过 SSE 服务器接入,可选择 Supergateway(独立服务或同机部署)或 Smithery.ai 托管。费用取决于各服务实际用量。

他们做了什么

作者 cngaspar 在 n8n 官方模板库发布了一个 51 节点的工作流模板。该模板通过 HubSpot 新联系人 webhook 或 Google Sheets Trigger(监控 status 列)触发,利用 n8n AI Agent 节点调用 Bright Data MCP 工具(LinkedIn 个人/公司资料、Crunchbase、搜索引擎等)自动补全线索字段。工作流内置 Structured Output Parser 定义了 30+ 字段的 JSON Schema,并配备 Auto-fixing Output Parser 处理格式失败。补全结果经 OpenAI gpt-4o-mini 评估置信度后,按 ≥85% 覆盖原记录、<85% 追加待审行、>89% 更新 HubSpot 联系人的逻辑路由。

效果如何

来源报告该模板可用于 B2B 线索丰富、邮箱情报、市场研究和 CRM 自动填充,声称无需代码即可将 Google Sheet 变为 AI 驱动的线索丰富引擎(author_report)。模板页面显示 5894 次查看。本站未实测运行成功或失败案例。

值得知道

1. SSE 服务器部署是额外基础设施负担:Supergateway 需 Node.js/Docker 环境,Smithery.ai 虽简单但引入第三方依赖。 2. 模板默认 SSE endpoint 为 http://localhost:8000/sse,云版 n8n 必须改用独立服务器或 Smithery 的公网 URL。 3. Bright Data MCP Client 仅启用 7 个工具(search_engine, web_data_linkedin_person_profile, web_data_linkedin_company_profile, web_data_linkedin_people_search, web_data_crunchbase_company, web_data_tiktok_profiles, web_data_instagram_profiles),如需其他数据源需手动调整。 4. Google Sheets 列名必须与 Structured Output Parser 的 Schema 一致,否则自动映射会失败。 5. HubSpot webhook 配置要求 n8n 实例能被公网访问以接收 HubSpot 推送;内网/本地测试需配合隧道工具。 6. Wait 节点名称为 'Space requests by 5 seconds',但 workflow.json 中 parameters 为空对象,实际延迟行为需以 n8n 运行时为准,可根据 Bright Data 速率限制调整。 7. 模板未提供 Bright Data 调用费用说明,实际成本取决于搜索和解锁次数。 8. 工作流包含一条手动触发重跑路径:'When clicking Execute workflow' → Google Sheets1(筛选 status='needs more enrichment')→ Process each leads one by one,用于批量重跑需要补充的线索。

n8n 工作流模板

结构已检查 · 未实际运行

下载后在 n8n 选择“Import from File”,或复制 JSON 后粘贴到编辑器。先配置自己的账号,再用测试数据运行;模板默认未启用。

配置与测试清单

需要绑定的凭证

  • googleSheetsTrigger 节点:绑定Google Sheets OAuth2 凭证。
  • lmChatOpenAi 节点:绑定OpenAI API 凭证。
  • openAi 节点:绑定OpenAI API 凭证。
  • googleSheets 节点:绑定Google Sheets OAuth2 凭证。

需要替换的配置

  • 源模板来自 n8n 公开库 #4589(约 51 个节点)。导入后先保持未启用,核对触发器、表达式与外部 API 端点。
  • Sticky Note 中的说明仅供参考;按自己的账号、表结构或频道 ID 替换占位配置。

测试输入与预期结果

  • 在测试环境手动执行一次主路径,确认每个需凭证的节点已连接且无鉴权错误。
  • 用一条合成/脱敏样例数据跑通,核对输出字段与下游写入目标,再考虑生产启用。

模板处理说明

  • 已移除原作者凭证绑定、webhookId 与执行数据,工作流设为未启用;节点、连线与原文提示词保持原样。未在 n8n 中实际运行。
  • 未改业务逻辑;运行前请自行核对密钥、配额与隐私合规。

模板获取日期: 2026-10-24

步骤

  1. 配置 HubSpot 认证

    在 HubSpot 中创建 Private App(推荐简单方案)或 OAuth App(高级安全方案),获取 Access Token 或 Client ID / Client Secret / Developer API key。在 n8n 中创建对应 HubSpot 凭证并关联节点。若使用 Private App,需在 HubSpot 中将 n8n Webhook 节点 URL 粘贴为 webhook 接收地址。

  2. 获取 Bright Data 凭据

    登录 Bright Data 账户,记录 API token;可选获取 Web Unlocker zone name 和 Browser API 认证字符串(username:password)。

  3. 部署 Bright Data MCP 的 SSE 服务器

    选择以下任一方式部署 SSE 服务器,使 n8n 可通过 HTTP SSE 调用 Bright Data MCP 工具: 方法 1(推荐):在独立云服务器(DigitalOcean、Heroku、Render 等)运行 Supergateway。NPM 方式设置环境变量 API_TOKEN、WEB_UNLOCKER_ZONE、BROWSER_AUTH,启动命令: npx -y supergateway --stdio "npx -y @brightdata/mcp" --port 8000 --baseUrl http://localhost:8000 --ssePath /sse --messagePath /message 部署后访问 https://your_server_url/sse。 方法 2:自托管 n8n 同机运行 Supergateway。设置相同环境变量,执行上述命令或设为预启动命令,访问 http://localhost:8000/sse。 方法 3(最简单):使用 Smithery.ai。访问 https://smithery.ai/server/@luminati-io/brightdata-mcp/tools 注册、创建 API key、配置环境变量并获取 SSE HTTP URL。

    搭建指导 · 来源原文。Supergateway NPM 启动命令;在独立服务器或自托管 n8n 的启动脚本中使用

    npx -y supergateway --stdio "npx -y @brightdata/mcp" --port 8000 --baseUrl http://localhost:8000 --ssePath /sse --messagePath /message

    搭建指导 · 来源原文。Supergateway Docker 启动命令

    docker run -it --rm -p 8000:8000 supercorp/supergateway \
        --stdio "npx -y @brightdata/mcp /" \
        --port 8000
  4. 准备并连接 Google Sheets

    确保 Google Sheet 包含列:row_id、first_name、last_name、email、status(以及后续会被填充的其他字段)。将表格共享给 n8n 服务账号,或通过 OAuth 连接。在 n8n 中添加 Google Sheets Trigger 节点,设置为监控该表格的新行或 status 列变更。

    搭建指导 · 来源原文。Google Sheets Trigger 节点旁的 Sticky Note;提醒用户在 status 列写入 'needs more enrichment' 以触发重试

    ## Watch for the updated record in Google Sheets based on the column 'status'
    Write 'needs more enrichment' in the status column if you want to retry the enrichment
  5. 导入工作流并配置节点凭证

    从模板导入 workflow JSON 到 n8n。依次配置以下节点凭证: - HubSpot:选择 App Token 或 OAuth 凭证 - Google Sheets Trigger / Google Sheets:链接到实际表格 - OpenAI Chat Model / OpenAI(Judge):填入 API key,按需选择模型(Scraper AI Agent 默认 gpt-4.1-mini;Judge 与 Auto-fixing 默认 gpt-4o-mini) - Bright Data MCP Client:填入 SSE 服务器 URL(如 https://your_server_url/sse 或 http://localhost:8000/sse) 检查 Structured Output Parser 的 JSON Schema 是否符合你的表格字段需求。

  6. 运行 AI Agent 执行线索丰富

    当 HubSpot 新增联系人或 Google Sheets status 为空 / 为 'needs more enrichment' 时,工作流触发。Scraper AI Agent 接收线索数据,按系统指令执行搜索与补全。

    运行提示词 · 来源原文。Scraper AI Agent 节点的 text 字段(user message);运行时自动注入当前线索 JSON

    =Here's the lead's data:
    
    {{ $json.toJsonString() }}

    运行提示词 · 来源原文。Scraper AI Agent 节点的 systemMessage 字段;定义搜索策略、来源要求与输出格式

    =Prompt: Person and Company Enrichment Task
    
    Objective:
    Enrich the lead’s information as completely and accurately as possible. Avoid fabricating data and maintain strict adherence to the correct tool schema for each tool used in the MCP client.
    
    ⸻
    
    1. Person Enrichment Instructions:
    - Start with a Google Search:
    Prioritize locating the individual’s LinkedIn profile URL using the available information.
    - Query Guidelines:
    - If the email address is available, use it in your search query.
    - If not, use the person’s first name and last name.
    - Always append keywords like “linkedin”, “facebook”, “instagram”, or other relevant social media platforms to refine the search.
    - LinkedIn-Based Enrichment:
    Once the LinkedIn URL is found, use it to gather available details from their profile.
    
    ⸻
    
    2. Company Enrichment Instructions:
    - Email Domain Extraction:
    If the person’s email is not from a generic provider (e.g., gmail.com, outlook.com, hotmail.com, icloud.com), extract the domain and use it in your search.
    - Query Composition:
    - Combine the extracted domain with any existing value in the “company” field of the lead’s details.
    - Do not rely on or reuse company data obtained from other tool outputs.
    - Focus on sourcing reliable company information from LinkedIn and Crunchbase.
    
    ⸻
    
    Output Format:
    
    Return the enriched data in valid JSON format using the original key structure. Exclude any fields that remain empty. Example output:
    
    {
      "first_name": "John",
      "last_name": "Doe",
      "address": "123 Maple Street, Apt 4",
      "instagram_handle": "johndoe38"
    }
  7. 置信度评分与结果回写

    AI Agent 输出经 Structured Output Parser 校验格式,若失败则由 Auto-fixing Output Parser 尝试修复。随后 Judge 节点用 gpt-4o-mini 对比原始数据与补全结果,输出 confidence(0-1)与 remarks。路由逻辑: - confidence ≥ 0.85:覆盖 Google Sheets 原记录;在此分支内,若 confidence > 0.89,额外经 No Operation → Set Desired Confidence Score 触发更新 HubSpot 联系人(含自定义属性 instagram_handle、facebook_handle、linkedin_url) - confidence < 0.85:追加新行(row_id 加时间戳),原记录 status 改为 'human review needed' - 若 Scraper 输出与原始数据的 first_name/last_name/email 完全不匹配(If/If1/If2 的 false 分支):经 Not matched route 仅更新 status 为 'no information found' 每次操作后经过 Wait 节点(名称为 'Space requests by 5 seconds',参数未显式设置,实际延迟取决于 n8n Wait 节点默认行为或名称暗示)再处理下一条。

    运行提示词 · 来源原文。Judge the accuracy of scraped data 节点的 system message;定义评分标准与输出格式

    Task:
    Evaluate the accuracy of the scraped data compared to the original source data.
    
    Instructions:
    - Assess how closely the scraped output matches the original data in terms of content, structure, and completeness.
    - Provide a confidence score based on the overall accuracy.
    - Explain your reasoning in concise, clear remarks.
    
    Output Format (JSON):
    
    {
      "confidence": [decimal between 0 and 1, e.g., 0.98 for 98% accuracy],
      "remarks": "A brief explanation justifying the confidence score, highlighting any discrepancies or issues found."
    }

    运行提示词 · 来源原文。Auto-fixing Output Parser 节点的 prompt 字段;格式修复失败时的回退指令

    Instructions:
    --------------
    {instructions}
    --------------
    Completion:
    --------------
    {completion}
    --------------
    
    Above, the Completion did not satisfy the constraints given in the Instructions.
    Error:
    --------------
    {error}
    --------------
    
    Please only return the first_name, last_name, email, and scrape_error (put the error details in this field)

可复制提示词

搭建指导 · 本站建议版本。交给搭建助手,先确认输入和权限,再引导逐步导入与测试

这一段是提示词,页面不会在这里插入广告。

你是一个 n8n 工作流搭建助手。用户想复现「HubSpot + Bright Data MCP + Google Sheets」的 AI 线索自动丰富模板。请先确认用户是否已具备以下前提:n8n 实例(云或自托管)、HubSpot 账号及 Private App/OAuth 权限、Bright Data MCP API token、OpenAI API key、Google Sheets(含 row_id/first_name/last_name/email/status 列)。若用户选择自托管 Bright Data MCP SSE 服务器,请确认其是否有额外服务器或是否使用 Smithery.ai。然后引导用户按步骤导入 workflow JSON、配置凭证、测试单条数据。不要替用户生成或发送任何密码/token。

粘贴 workflow JSON 后,优先检查 HubSpot 和 Google Sheets 凭证是否已正确关联;首次运行建议用 Manual Trigger + 单条样本数据测试。注意:工作流还包含一条手动重跑路径——'When clicking Execute workflow' → Google Sheets1(查找 status='needs more enrichment' 的记录)→ Process each leads one by one,可用于批量重跑需补充的线索。

来源

AI-powered lead enrichment with Bright Data MCP and Google Sheets · cngaspar · n8n.io · 2025-06-02

留言与反馈

试过这个方法吗?分享效果、遇到的问题或改进建议。留言审核后公开,请勿填写敏感信息。

正在加载…

    相关用例