HubSpot + CompanyEnrich: cleaner company data
Your HubSpot company records look “fine” until you try to use them. Missing domains, blank industry fields, messy firmographics, and half-filled properties turn segmentation and scoring into a guessing game.
This HubSpot enrichment automation hits RevOps teams hardest, but Sales Ops and growth marketers feel it too. Cleaner company data means your lists actually match reality, your routing rules fire correctly, and your outbound isn’t built on placeholders.
This workflow pulls recently updated companies from HubSpot, enriches them by domain with CompanyEnrich, and writes the best data back automatically. You’ll see how it works, what you need, and where teams typically tweak it.
How This Automation Works
The full n8n workflow, from trigger to final output:
n8n Workflow Template: HubSpot + CompanyEnrich: cleaner company data
flowchart LR
subgraph sg0["Schedule Flow"]
direction LR
n0@{ icon: "mdi:code-braces", form: "rounded", label: "Extract Domain", pos: "b", h: 48 }
n1["<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/httprequest.dark.svg' width='40' height='40' /></div><br/>CompanyEnrich - Enrich by Do.."]
n2@{ icon: "mdi:swap-horizontal", form: "rounded", label: "Check Enrich Success", pos: "b", h: 48 }
n3["<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/>HubSpot - Update Company"]
n4@{ icon: "mdi:cog", form: "rounded", label: "On Error (Log)", pos: "b", h: 48 }
n5@{ icon: "mdi:play-circle", form: "rounded", label: "Schedule Trigger", pos: "b", h: 48 }
n6@{ icon: "mdi:swap-vertical", form: "rounded", label: "Loop Over Items", pos: "b", h: 48 }
n7["<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/merge.svg' width='40' height='40' /></div><br/>Merge"]
n8["<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/>Get recently created/updated.."]
n7 --> n2
n0 --> n6
n4 --> n6
n6 --> n1
n6 --> n7
n5 --> n8
n2 --> n3
n2 --> n4
n3 --> n6
n1 --> n7
n8 --> n0
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 n5 trigger
class n2 decision
class n1 api
class n0 code
classDef customIcon fill:none,stroke:none
class n1,n3,n7,n8 customIcon
The Problem: HubSpot company data gets stale (fast)
Company records don’t stay clean on their own. One rep enters “acme.com,” another pastes a LinkedIn URL, and a third leaves the domain empty because they’re rushing to log the call. A week later you’re trying to build a segment for “US SaaS companies with 50–200 employees,” and half the list is missing the basics. Then the cleanup work starts: exporting, looking up domains, copying firmographics, re-importing, and hoping you didn’t overwrite something important. It’s tedious, and honestly it’s the kind of busywork that quietly breaks good GTM systems.
The friction compounds. Here’s where it breaks down in real life.
- Records get created without a usable domain, so enrichment tools can’t match the company.
- Teams end up with inconsistent properties, which makes lead scoring and routing rules unreliable.
- Manual enrichment happens in bursts, so your dashboards and segments are always a week behind.
- Someone has to own “CRM hygiene,” and that time usually comes out of higher-value ops work.
The Solution: Enrich HubSpot companies by domain, on a schedule
This workflow keeps HubSpot company records enriched automatically using CompanyEnrich, without you babysitting spreadsheets. It runs on a recurring schedule (weekly by default), pulls recently created or updated companies from HubSpot, and extracts a clean domain even when the domain is stored inconsistently. Each domain is sent to the CompanyEnrich API for enrichment. If the enrichment succeeds, the workflow maps the returned data into HubSpot-friendly fields and updates the company record. If it fails, it logs the failure and keeps moving, so one bad record doesn’t stop the whole run.
The workflow starts with a scheduled run, then fetches recent companies from HubSpot. Next it derives the domain and processes companies in batches to avoid rate limits. Finally, it updates HubSpot for successes and logs failures for follow-up.
What You Get: Automation vs. Results
| What This Workflow Automates | Results You’ll Get |
|---|---|
|
|
Example: What This Looks Like
Say your team creates or updates about 120 company records a week. Manually enriching even 5 minutes per record is roughly 10 hours, and it’s usually split across random pockets of time (which makes it feel worse). With this workflow, you set a weekly schedule and let it run in batches in the background. Your “time spent” becomes checking a short failure log and fixing domains for maybe a handful of records, which is closer to 20 minutes than a half-day of work.
What You’ll Need
- n8n instance (try n8n Cloud free)
- Self-hosting option if you prefer (Hostinger works well)
- HubSpot for reading and updating company records
- CompanyEnrich to enrich companies by domain
- CompanyEnrich API key (get it from your CompanyEnrich dashboard)
Skill level: Intermediate. You’ll connect credentials, confirm property mappings, and test on a small batch before letting it run on autopilot.
Don’t want to set this up yourself? Talk to an automation expert (free 15-minute consultation).
How It Works
A scheduled check for new and updated companies. The workflow kicks off weekly by default using a Schedule Trigger. If you prefer daily cleanup or an on-demand run, you can adjust the trigger (or swap to a webhook trigger).
Recent company records are pulled from HubSpot. n8n fetches companies that were recently created or updated, so you’re not re-enriching your entire database every time. That keeps runs fast and avoids unnecessary API usage.
The domain is normalized and processed in batches. A Function node derives the company domain safely, even if it lives in different properties or includes extra formatting. Then “Split in Batches” loops through companies in manageable chunks, which helps you stay under rate limits.
CompanyEnrich enrichment and conditional updates. Each domain is sent via HTTP Request to the CompanyEnrich API. An If check confirms the response is successful before the workflow maps fields and updates the company in HubSpot; failed responses are logged and the loop continues.
You can easily modify which companies qualify for enrichment to match your needs. See the full implementation guide below for customization options.
Step-by-Step Implementation Guide
Step 1: Configure the Schedule Trigger
Set up the workflow’s schedule so it runs on a recurring weekly interval.
- Add and open Scheduled Run Starter.
- Set the Rule interval to
weeks(as configured in the node). - Confirm the trigger connects to Fetch Recent Companies per the execution flow.
Step 2: Connect HubSpot and Fetch Recent Companies
Retrieve recently created or updated companies from HubSpot.
- Open Fetch Recent Companies and set Resource to
companyand Operation togetRecentlyCreatedUpdated. - Enable Return All by setting it to
true. - In Additional Fields → Since, keep the expression
{{ new Date(new Date($json.timestamp).getTime() - 7*24*60*60*1000) .toISOString() .slice(0,10) }}to pull the last 7 days of updates. - Credential Required: Connect your
hubspotAppTokencredentials.
Step 3: Prepare Company Data and Batch Processing
Normalize company IDs and domains, then process them in batches.
- Open Derive Company Domain and keep the provided Function Code that extracts
companyIdanddomain. - Connect Derive Company Domain to Iterate Records Batch.
- In Iterate Records Batch, leave Options → Reset set to
false. - Confirm Iterate Records Batch outputs to both CompanyEnrich Domain Lookup and Combine Streams as configured.
Step 4: Enrich Companies and Validate Results
Call the enrichment API, merge the results, and validate success before updates.
- Open CompanyEnrich Domain Lookup and set URL to
https://api.companyenrich.com/companies/enrich. - Enable Send Query and set the domain query parameter to
{{ $json.domain }}. - Enable Send Headers, set Specify Headers to
json, and keep JSON Headers as{ "Authorization": "Bearer [CONFIGURE_YOUR_TOKEN]", "Accept": "application/json" }(replace the token). - Open Combine Streams and set Mode to
combineand Combine By tocombineByPosition. - Open Validate Enrichment Result and keep the string condition
{{ $json && $json.statusCode ? String($json.statusCode) : '' }}with Operation set toisEmptyto gate successful results.
[CONFIGURE_YOUR_TOKEN] with your actual CompanyEnrich token.Step 5: Configure HubSpot Updates and Failure Logging
Apply enrichment data to HubSpot and route failures to a logging step.
- Open Update HubSpot Company and set Resource to
company, Operation toupdate, and Company ID to{{ $json.companyId }}. - Map update fields exactly as configured, including City
{{ $json.location.city.name }}, Name{{ $json.name }}, Company Domain Name{{ $json.domain }}, and LinkedIn Company Page{{ $json.socials.linkedin_url }}. - Credential Required: Connect your
hubspotAppTokencredentials in Update HubSpot Company. - Ensure the false branch of Validate Enrichment Result routes to Log Failure, then back to Iterate Records Batch to continue processing.
Step 6: Test and Activate Your Workflow
Run a manual test to confirm enrichment and updates, then activate the schedule.
- Click Execute Workflow to run the workflow manually from Scheduled Run Starter.
- Verify that CompanyEnrich Domain Lookup returns enriched data and that Update HubSpot Company applies changes to a sample company.
- Confirm failures route through Validate Enrichment Result to Log Failure without stopping the batch loop.
- When successful, toggle the workflow Active so it runs on the weekly schedule.
Common Gotchas
- HubSpot credentials can expire or lack company write permissions. If updates stop showing up, check your HubSpot private app token scopes and the credential in n8n first.
- If you’re using batch processing and an external API, processing times vary. If downstream nodes fail on empty responses, reduce batch size or add a short wait before merging responses.
- Domain quality matters more than most teams expect. If records store “http://example.com” or a LinkedIn URL, fix the extraction logic in the domain-derivation step or you’ll get lots of failed enrichments.
Frequently Asked Questions
About an hour if your HubSpot token and CompanyEnrich key are ready.
No. You’ll mostly connect accounts and confirm field mappings in HubSpot. The only “code-like” part is reviewing the domain extraction logic, and it’s already provided in the workflow.
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 CompanyEnrich API costs based on your usage.
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 it’s a common tweak. You can filter right after “Fetch Recent Companies” to only enrich certain segments (for example, lifecycle stage, target account list, country, or a specific pipeline). Another option is to only run enrichment when a “needs enrichment” checkbox is true, then flip it off after “Update HubSpot Company.” If you want to enrich different properties, adjust the mapping step before the update so the CompanyEnrich fields land in your custom HubSpot properties.
Most of the time it’s an app token scope issue or an expired credential in n8n. Confirm your HubSpot private app has company read/write access, then re-save the credential in n8n. Also check if you hit HubSpot rate limits during large backfills, because that can look like random failures even though the setup is correct.
A lot, because it processes in batches and loops until the list is finished. On n8n Cloud, your practical cap is your monthly executions and how many companies you enrich per run; self-hosting removes the execution cap and shifts the limit to your server and API rate limits. In practice, most teams comfortably handle hundreds to a few thousand companies per scheduled run when the batch size is reasonable.
Usually, yes, if you care about batching and control. This workflow loops through companies in chunks, validates API responses, and continues even when some records fail, which is the kind of logic that gets awkward (or expensive) in simpler automation tools. n8n also gives you self-hosting if you want unlimited runs. Zapier or Make can be fine for small volumes, like enriching a single company on create, but scheduled bulk cleanup tends to be smoother here. If you’re torn, Talk to an automation expert and describe your volume and segmentation needs.
Clean company data is the foundation for everything else you do in HubSpot. Set this up once, let it run, and keep your segments, scoring, and reporting from drifting into nonsense.
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.