HubSpot + SerpAPI: enriched contacts, ready to segment
New leads hit HubSpot, and then the scramble starts. Someone has to figure out who the company is, what they do, where they’re based, and if the contact is even worth routing to sales.
Marketing Ops usually gets stuck cleaning fields. SDRs feel it when personalization is basically guesswork. And founders doing their own outbound? Same story. This HubSpot enrichment automation fills in the missing company context automatically so your lists are actually segmentable.
This workflow finds new HubSpot contacts from the last day, skips free email domains, researches the company using SerpAPI plus an AI agent, and writes clean, structured fields back to HubSpot. You’ll see what it does, what you need, and how teams use it day-to-day.
How This Automation Works
The full n8n workflow, from trigger to final output:
n8n Workflow Template: HubSpot + SerpAPI: enriched contacts, ready to segment
flowchart LR
subgraph sg0["Scheduled Daily Flow"]
direction LR
n0["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/hubspot.svg' width='40' height='40' /></div><br/>Retrieve Recent Contacts"]
n1@{ icon: "mdi:wrench", form: "rounded", label: "SerpAPI Web Search", pos: "b", h: 48 }
n2@{ icon: "mdi:swap-horizontal", form: "rounded", label: "Filter Last-Day Contacts", pos: "b", h: 48 }
n3@{ icon: "mdi:brain", form: "rounded", label: "Gemini Chat Model", pos: "b", h: 48 }
n4@{ icon: "mdi:robot", form: "rounded", label: "Company Insight Agent", pos: "b", h: 48 }
n5@{ icon: "mdi:robot", form: "rounded", label: "Structured JSON Parser", pos: "b", h: 48 }
n6["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/hubspot.svg' width='40' height='40' /></div><br/>Update Contact Company Info"]
n7@{ icon: "mdi:play-circle", form: "rounded", label: "Scheduled Daily Trigger", pos: "b", h: 48 }
n7 --> n0
n4 --> n6
n3 -.-> n4
n5 -.-> n4
n1 -.-> n4
n0 --> n2
n2 --> n4
end
%% Styling
classDef trigger fill:#e8f5e9,stroke:#388e3c,stroke-width:2px
classDef ai fill:#e3f2fd,stroke:#1976d2,stroke-width:2px
classDef aiModel fill:#e8eaf6,stroke:#3f51b5,stroke-width:2px
classDef decision fill:#fff8e1,stroke:#f9a825,stroke-width:2px
classDef database fill:#fce4ec,stroke:#c2185b,stroke-width:2px
classDef api fill:#fff3e0,stroke:#e65100,stroke-width:2px
classDef code fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
classDef disabled stroke-dasharray: 5 5,opacity: 0.5
class n7 trigger
class n4,n5 ai
class n3 aiModel
class n1 ai
class n2 decision
classDef customIcon fill:none,stroke:none
class n0,n6 customIcon
The Problem: New contacts come in “blank”
A new HubSpot contact with only a name and email looks fine until you try to do anything useful with it. You can’t segment by industry because the industry field is empty. You can’t route by territory because there’s no HQ country. And outreach feels generic because you don’t know what the company actually does. So you open Google. Then LinkedIn. Then maybe Crunchbase. Ten minutes later you’ve “enriched” one contact, and five more have arrived. It’s not hard work. It’s endless work.
The friction compounds. Here’s where it breaks down.
- Your team spends about 10 minutes per new contact doing basic lookup.
- Free email domains (gmail.com, etc.) pollute B2B lists and waste enrichment time.
- Details get added inconsistently, which makes segments unreliable and reporting messy.
- Personalization gets delayed, so follow-ups happen after the lead has cooled.
The Solution: Daily contact enrichment inside HubSpot
This n8n workflow runs on a daily schedule and looks for HubSpot contacts created in the last 24 hours. Before it enriches anything, it filters out free email domains so you don’t waste time profiling personal inboxes. For each remaining contact, it extracts the company domain from the email address, uses SerpAPI to research the company online, and asks an AI research agent to turn that research into clean, structured fields. Finally, it updates the HubSpot contact with consistent properties like company name, industry, HQ city and country, employee count, website, LinkedIn URL, and a short description. The result is a CRM that gets more useful every morning, without anyone touching a spreadsheet.
The workflow starts with a scheduled daily trigger, pulls recent contacts from HubSpot, then routes only “good” records into the AI research agent. After SerpAPI-backed research returns structured JSON, HubSpot gets updated automatically with enrichment fields your team can segment on.
What You Get: Automation vs. Results
| What This Workflow Automates | Results You’ll Get |
|---|---|
|
|
Example: What This Looks Like
Say your inbound flow creates 20 new HubSpot contacts per day. If it takes about 10 minutes to look up company name, industry, HQ, and LinkedIn, that’s roughly 3 hours of busywork every day (and it usually lands on the same person). With this workflow, the “time spent” is basically checking results: maybe 10 minutes skimming any odd entries, while the scheduled run does the research and updates the records in the background. That’s a few hours back each week, without changing how leads enter HubSpot.
What You’ll Need
- n8n instance (try n8n Cloud free)
- Self-hosting option if you prefer (Hostinger works well)
- HubSpot to read and update contact properties.
- SerpAPI to pull web search results for company research.
- Google Gemini API key (get it from Google AI Studio) to run the AI research agent.
Skill level: Intermediate. You’ll connect accounts, confirm field mappings, and adjust a filter or prompt if your data is messy.
Don’t want to set this up yourself? Talk to an automation expert (free 15-minute consultation).
How It Works
A daily schedule kicks things off. Once per day, the workflow runs automatically so enrichment happens in batches, not ad hoc when someone remembers.
HubSpot is queried for fresh contacts. It pulls contacts created (or updated, depending on your setup) in the last 24 hours, giving you a clean “new lead” set to work from.
Low-value records are filtered out early. Contacts with free email domains like gmail.com are excluded by default, which keeps the workflow focused on business domains you can actually profile.
SerpAPI plus an AI agent turns a domain into usable fields. The workflow extracts the domain from the email address, runs web research, and returns structured JSON like company name, industry, HQ, employee count, website, LinkedIn, and a short description.
HubSpot gets updated automatically. Those fields are written back onto the contact record so lists, views, routing, and personalization tokens have real data to work with.
You can easily modify the free-domain filter to include yahoo.com or outlook.com, or change the fields written back to match your exact HubSpot properties. See the full implementation guide below for customization options.
Step-by-Step Implementation Guide
Step 1: Configure the Scheduled Daily Trigger
Set the workflow to run on a daily schedule so it can check for newly created or updated HubSpot contacts.
- Add the Scheduled Daily Trigger node as your workflow trigger.
- In Scheduled Daily Trigger, keep the default Rule settings (interval schedule is already configured).
Step 2: Connect HubSpot and Filter Recent Contacts
Pull the most recent contacts from HubSpot and filter to those created within the last day while excluding personal email domains.
- Add Retrieve Recent Contacts and connect it to Scheduled Daily Trigger.
- In Retrieve Recent Contacts, set Operation to
getRecentlyCreatedUpdatedand Limit to1. - Credential Required: Connect your hubspotOAuth2Api credentials in Retrieve Recent Contacts.
- Add Filter Last-Day Contacts after Retrieve Recent Contacts.
- In Filter Last-Day Contacts, set the date condition Left Value to
{{ $json.properties.createdate.value.toDateTime('ms') }}and Right Value to{{ $today.minus(1, 'days') }}with After or equals. - Add the second condition to exclude personal emails: Left Value
{{ $json['identity-profiles'][0].identities[0].value }}, OperationnotContains, Right Valuegmail.com.
Step 3: Set Up AI Enrichment with Company Insight Agent
Configure the AI agent and its tools to research company details from each contact’s email domain.
- Add Company Insight Agent and connect it to Filter Last-Day Contacts.
- In Company Insight Agent, keep the Prompt Type set to
defineand ensure Text includes the domain expression{{ $json['identity-profiles'][0].identities[0].value }}. - Add Gemini Chat Model as the language model for Company Insight Agent.
- Credential Required: Connect your googlePalmApi credentials in Gemini Chat Model.
- Add SerpAPI Web Search as a tool to Company Insight Agent so it can search the web for company data.
- Credential Required: Connect your serpApi credentials for the tool used by Company Insight Agent (add credentials at the parent agent configuration, not directly on the tool node).
- Add Structured JSON Parser as the output parser for Company Insight Agent and keep the JSON Schema Example as provided.
Step 4: Configure Output to Update HubSpot Contacts
Map the AI-enriched company data back into HubSpot contact properties.
- Add Update Contact Company Info and connect it to Company Insight Agent.
- In Update Contact Company Info, set Email to
{{ $('Retrieve Recent Contacts').item.json['identity-profiles'][0].identities[0].value }}. - Map additional fields to the parser output: City
{{ $json.output.headquarters_city }}, Country{{ $json.output.headquarters_country }}, Website URL{{ $json.output.website }}, Company Name{{ $json.output.company_name }}, Company Size{{ $json.output.employee_count }}, LinkedIn URL{{ $json.output.linkedin }}. - Credential Required: Connect your hubspotOAuth2Api credentials in Update Contact Company Info.
Step 5: Test and Activate Your Workflow
Verify that the workflow enriches a recent contact and writes company data back to HubSpot before enabling production runs.
- Click Execute Workflow to run the flow manually from Scheduled Daily Trigger.
- Confirm that Retrieve Recent Contacts returns a contact and Filter Last-Day Contacts allows it through.
- Verify Company Insight Agent produces structured output and Update Contact Company Info writes fields back to HubSpot.
- When the test is successful, toggle the workflow to Active to run daily.
Common Gotchas
- HubSpot OAuth credentials can expire or lose scopes after admin changes. If updates suddenly stop, check the HubSpot connection inside n8n credentials first.
- SerpAPI can hit rate limits if you enrich lots of contacts at once. Watch the SerpAPI usage dashboard and consider running the workflow hourly with smaller batches.
- Gemini prompts that are too generic produce vague industries and shaky employee counts. Honestly, add your preferred categories and formatting rules early, or you’ll be cleaning “Other” forever.
Frequently Asked Questions
About 30 minutes if your HubSpot properties are ready.
No. You connect HubSpot, SerpAPI, and Gemini, then confirm the field mapping.
Yes. n8n has a free self-hosted option and a free trial on n8n Cloud. Cloud plans start at $20/month for higher volume. You’ll also need to factor in SerpAPI and Gemini usage costs.
Two options: n8n Cloud (managed, easiest setup) or self-hosting on a VPS. For self-hosting, Hostinger VPS is affordable and handles n8n well. Self-hosting gives you unlimited executions but requires basic server management.
Yes, and you probably should. A common tweak is “confidence gating,” which means you only update HubSpot when the agent returns both a website and a LinkedIn URL. You can also expand the structured output to match your picklists (industry values, country names) so segmentation doesn’t fracture. The easiest place to do this is in the agent prompt and the field mapping in the “Update Contact Company Info” step.
Usually it’s expired OAuth access in n8n or missing permissions after a HubSpot admin change. Reconnect the HubSpot credential in n8n and confirm the integration still has access to read and write contacts. If it fails only on updates, double-check the target properties exist and are writable.
A typical setup handles dozens to hundreds of contacts per day without issue, and if you self-host n8n there’s no execution cap beyond your server capacity.
Often, yes, because this workflow benefits from branching logic, filtering, and structured AI outputs in one place. n8n also gives you the option to self-host, which matters when you’re enriching leads daily and don’t want per-task pricing surprises. Zapier or Make can still work if your enrichment is very light and you’re comfortable with simpler paths. The moment you want confidence checks, “skip these domains,” or better prompt control, n8n tends to feel more manageable. If you want a second opinion, Talk to an automation expert and describe your lead volume and routing rules.
Your CRM becomes more than a dumping ground when every new contact arrives with context. Set this up once, and the next morning your segments are ready to use.
Need Help Setting This Up?
Our automation experts can build and customize this workflow for your specific needs. Free 15-minute consultation—no commitment required.