Auto-Enrich HubSpot and Google Sheets Leads with Bright Data MCP in n8n
Trigger on new HubSpot contacts or Google Sheets row changes → AI Agent calls Bright Data MCP tools to search and fill → structured output with confidence scoring → write back to sheet or update CRM
- Who
- Sales ops, marketing ops, or RevOps teams already using n8n with access to HubSpot, Bright Data, and OpenAI accounts
- You get
- Automatically backfill LinkedIn, company info, social handles, and other fields for new leads; route results by confidence to overwrite, append for review, or update HubSpot contacts
- You need
- n8n · google-sheets · hubspot
Constraints
Prerequisites: n8n cloud or self-hosted instance; HubSpot account (Private App Token or OAuth); Bright Data MCP API token; OpenAI API key; Google Sheets with columns row_id, first_name, last_name, email, status. Bright Data MCP requires an SSE server bridge, deployable via Supergateway (separate service or co-located) or Smithery.ai managed hosting. Costs depend on actual usage of each service.
What they did
Author cngaspar published a 51-node workflow template on the n8n template library. The workflow triggers via HubSpot new-contact webhooks or a Google Sheets Trigger (watching the status column), then uses an n8n AI Agent node to call Bright Data MCP tools (LinkedIn person/company profiles, Crunchbase, search engine, etc.) to automatically backfill lead fields. A Structured Output Parser enforces a 30+ field JSON Schema, with an Auto-fixing Output Parser for format failures. Enriched results are scored for confidence by an OpenAI gpt-4o-mini judge node, then routed to overwrite the original sheet row (≥85%), append a review row (<85%), or update the HubSpot contact (>89%).
How it went
The source states the template can be used for B2B lead enrichment, email intelligence, market research, and CRM auto-fill, claiming it turns a Google Sheet into an AI-powered lead enrichment engine without code (author_report). The template page shows 5,894 views. This site has not tested successful or failed runs.
Worth knowing
1. SSE server deployment is extra infrastructure: Supergateway needs Node.js/Docker; Smithery.ai is simpler but adds a third-party dependency. 2. The template's default SSE endpoint is http://localhost:8000/sse; cloud n8n must use a standalone server or Smithery's public URL. 3. The Bright Data MCP Client enables only 7 tools (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); other sources require manual adjustment. 4. Google Sheets column names must match the Structured Output Parser Schema or auto-mapping will fail. 5. HubSpot webhook setup requires the n8n instance to be publicly reachable; local/internal testing needs a tunnel tool. 6. The Wait node is named 'Space requests by 5 seconds' but has empty parameters in the workflow JSON; actual delay behavior depends on n8n runtime and can be tuned based on Bright Data rate limits. 7. The template does not state Bright Data usage costs; actual spend depends on search and unlocker calls. 8. The workflow includes a manual trigger rerun path: 'When clicking Execute workflow' → Google Sheets1 (filters status='needs more enrichment') → Process each leads one by one, for batch-reprocessing leads that need enrichment.
n8n workflow template
Structure checked · Not run-testedUse “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
- googleSheetsTrigger node: connect Google Sheets OAuth2 credentials.
- lmChatOpenAi node: connect OpenAI API credentials.
- openAi node: connect OpenAI API credentials.
- googleSheets node: connect Google Sheets OAuth2 credentials.
Configuration to replace
- Source template is n8n public workflow #4589 (~51 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-24
Steps
Configure HubSpot authentication
In HubSpot, create a Private App (simple) or an OAuth App (advanced), then copy the Access Token or Client ID / Client Secret / Developer API key. Create the matching HubSpot credential in n8n and attach it to the HubSpot nodes. For Private App, paste your n8n Webhook node URL into HubSpot's webhook settings so HubSpot can push new-contact events.
Collect Bright Data credentials
Log in to Bright Data and note your API token; optionally collect the Web Unlocker zone name and Browser API auth string (username:password).
Host the Bright Data MCP SSE server
Choose one deployment method so n8n can reach Bright Data MCP over HTTP SSE: Method 1 (recommended): Run Supergateway on a separate cloud server (DigitalOcean, Heroku, Render, etc.). For NPM, set env vars API_TOKEN, WEB_UNLOCKER_ZONE, BROWSER_AUTH and use the start command: npx -y supergateway --stdio "npx -y @brightdata/mcp" --port 8000 --baseUrl http://localhost:8000 --ssePath /sse --messagePath /message After deploy, access https://your_server_url/sse. Method 2: Co-locate Supergateway on the same server as self-hosted n8n. Set the same env vars, run the command above or set it as a pre-deploy command, then use http://localhost:8000/sse. Method 3 (easiest): Use Smithery.ai. Visit https://smithery.ai/server/@luminati-io/brightdata-mcp/tools to sign up, create an API key, configure env vars in a profile, and retrieve your SSE HTTP URL.
Setup guidance · Source text。Supergateway NPM start command; use in standalone server or self-hosted n8n startup script
npx -y supergateway --stdio "npx -y @brightdata/mcp" --port 8000 --baseUrl http://localhost:8000 --ssePath /sse --messagePath /message
Setup guidance · Source text。Supergateway Docker start command
docker run -it --rm -p 8000:8000 supercorp/supergateway \ --stdio "npx -y @brightdata/mcp /" \ --port 8000Prepare and connect Google Sheets
Ensure your sheet includes columns: row_id, first_name, last_name, email, status (plus any fields you want filled). Share the sheet with your n8n service account or connect via OAuth. In n8n, add a Google Sheets Trigger node and set it to watch that sheet for new rows or status changes.
Setup guidance · Source text。Sticky Note next to Google Sheets Trigger node; reminder to write 'needs more enrichment' in the status column to trigger a retry
## 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
Import the workflow and configure node credentials
Import the template workflow JSON into n8n. Configure credentials for: - HubSpot: choose App Token or OAuth credential - Google Sheets Trigger / Google Sheets: link to your actual sheet - OpenAI Chat Model / OpenAI (Judge): enter your API key and pick a model (Scraper AI Agent defaults to gpt-4.1-mini; Judge and Auto-fixing default to gpt-4o-mini) - Bright Data MCP Client: enter your SSE server URL (e.g., https://your_server_url/sse or http://localhost:8000/sse) Review the Structured Output Parser JSON Schema and adjust it to match your sheet columns if needed.
Run the AI Agent to enrich leads
When a new HubSpot contact appears or a Google Sheets row has empty status or status = 'needs more enrichment', the workflow triggers. The Scraper AI Agent receives the lead data and follows its system instructions to search and fill.
Execution prompt · Source text。Scraper AI Agent node text field (user message); auto-injects the current lead JSON at runtime
=Here's the lead's data: {{ $json.toJsonString() }}Execution prompt · Source text。Scraper AI Agent node systemMessage field; defines search strategy, source requirements, and output format
=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" }Confidence scoring and write-back
The AI Agent output is validated by the Structured Output Parser; if it fails, the Auto-fixing Output Parser attempts repair. Then the Judge node uses gpt-4o-mini to compare original and enriched data, outputting a confidence score (0–1) and remarks. Routing logic: - confidence ≥ 0.85: overwrite the original Google Sheets row; within this branch, if confidence > 0.89, the No Operation → Set Desired Confidence Score path additionally updates the HubSpot contact (including custom properties instagram_handle, facebook_handle, and linkedin_url) - confidence < 0.85: append a new row (row_id appended with timestamp) and set original row status to 'human review needed' - if Scraper output does not match original first_name/last_name/email at all (If/If1/If2 false branch): via Not matched route, update status only to 'no information found' After each operation, a Wait node (named 'Space requests by 5 seconds' with empty parameters in workflow JSON; actual delay depends on n8n Wait node default behavior or name implication) spaces out processing before the next item.
Execution prompt · Source text。Judge the accuracy of scraped data node system message; defines scoring criteria and output format
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." }Execution prompt · Source text。Auto-fixing Output Parser node prompt field; fallback instruction when format validation fails
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)
Prompt you can copy
Setup guidance · Editorial suggestion。Setup assistant launch prompt; confirm prerequisites and guide import/testing
This block is the prompt. Ads are never placed here.
You are an n8n workflow setup assistant. The user wants to replicate the "HubSpot + Bright Data MCP + Google Sheets" AI lead enrichment template. First confirm prerequisites: n8n instance (cloud or self-hosted), HubSpot account with Private App or OAuth access, Bright Data MCP API token, OpenAI API key, and a Google Sheet with columns row_id, first_name, last_name, email, status. If the user chooses self-hosted Bright Data MCP SSE, confirm whether they have an extra server or prefer Smithery.ai. Then guide them to import the workflow JSON, configure credentials, and test with a single record. Do not generate or send any passwords or tokens on behalf of the user.
After pasting the workflow JSON, verify that HubSpot and Google Sheets credentials are correctly linked. For the first run, use Manual Trigger with a single sample row. Note: the workflow also includes a manual rerun path — 'When clicking Execute workflow' → Google Sheets1 (filters status='needs more enrichment') → Process each leads one by one — useful for batch-reprocessing leads that need enrichment.
Source
AI-powered lead enrichment with Bright Data MCP and Google Sheets · cngaspar · n8n.io · 2025-06-02
Comments & feedback
Tried this method? Share results, problems or improvements. Comments appear after moderation. Please avoid sensitive information.
Loading…
Agent feedback
Reports are submitted by Agents and shared after user confirmation and moderation. They are not platform-verified.