HubSpot + CEIDG: company records fill themselves
Someone adds a NIP to a HubSpot company record, and suddenly you’re playing detective. Copying addresses from public registers, hunting for websites, fixing weird formatting. It’s slow, and it’s how bad data sneaks into your CRM.
CRM admins usually get blamed when records are messy, but sales ops and agency teams feel it every day too. This HubSpot CEIDG automation fills company fields from official CEIDG data so you stop retyping the basics and second-guessing what’s correct.
Below you’ll see what the workflow does, what you’ll need, and how to get predictable, cleaner company records when a NIP changes.
How This Automation Works
The full n8n workflow, from trigger to final output:
n8n Workflow Template: HubSpot + CEIDG: company records fill themselves
flowchart LR
subgraph sg0["When NIP property changes Flow"]
direction LR
n0@{ icon: "mdi:swap-horizontal", form: "rounded", label: "Check if NIP exists", 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/hubspot.svg' width='40' height='40' /></div><br/>When NIP property changes"]
n2["<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 company in HubSpot"]
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/httprequest.dark.svg' width='40' height='40' /></div><br/>Fetch company data from CEIDG"]
n4["<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/code.svg' width='40' height='40' /></div><br/>Transform data for HubSpot"]
n5["<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/>Mark error in HubSpot"]
n6@{ icon: "mdi:swap-horizontal", form: "rounded", label: "Check if data retrieved", pos: "b", h: 48 }
n0 --> n3
n0 --> n5
n6 --> n4
n6 --> n5
n1 --> n0
n4 --> n2
n3 --> n6
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 n1 trigger
class n0,n6 decision
class n3 api
class n4 code
classDef customIcon fill:none,stroke:none
class n1,n2,n3,n4,n5 customIcon
The Problem: HubSpot company data goes stale (or wrong)
HubSpot is only as useful as the data inside it. But company records are often built in a rush: someone pastes a NIP, leaves the name as “New Company,” and moves on. Later, your team needs an invoice address, a website, or a phone number, so they Google it, copy whatever looks right, and hope it matches official data. That creates duplicates (“ABC Jan Kowalski” vs. “ABC Kowalski”), broken segmentation, and reporting you can’t trust. Honestly, it also creates friction between teams because nobody wants to own cleanup.
It adds up fast. Here’s where it breaks down in real life:
- People retype the same fields repeatedly, and every manual entry is a chance to introduce a typo.
- A wrong postal code or street format can derail invoicing and create awkward “please confirm your address” emails.
- Sales sequences and territory rules misfire when city, region, or website fields are inconsistent.
- When you finally try to clean the CRM, you discover you don’t know which record reflects official registry data.
The Solution: NIP-triggered CEIDG enrichment inside HubSpot
This workflow watches HubSpot company records for changes to your “nip” property. The moment a NIP is added or updated, it checks that the field is not empty and then calls the official Polish CEIDG database via an HTTP request using your CEIDG API token. If CEIDG returns a valid match, the workflow maps the official fields into your HubSpot company properties and updates the record automatically. If CEIDG does not return data (invalid NIP, not found, or a temporary response issue), the workflow flags the record and writes a note back to HubSpot so the team knows what happened. No guessing. No silent failures.
The workflow starts in HubSpot when a NIP changes. CEIDG is queried and the response is validated. Then the data is transformed into the exact property structure HubSpot expects, and the company record is updated (or tagged with an error note).
What You Get: Automation vs. Results
| What This Workflow Automates | Results You’ll Get |
|---|---|
|
|
Example: What This Looks Like
Say your team creates 20 new HubSpot company records a week for Polish sole proprietors. Manually, collecting name, full address, website, phone, and REGON is usually about 10 minutes per record, so you’re spending about 3 hours weekly just on enrichment. With this workflow, a rep pastes the NIP (maybe 30 seconds), and the rest is automated after the CEIDG lookup. Even if you budget a minute to sanity-check the result, you still get a few hours back every week, and the CRM stays consistent.
What You’ll Need
- n8n instance (try n8n Cloud free)
- Self-hosting option if you prefer (Hostinger works well)
- HubSpot to trigger and update company properties.
- CEIDG API for official Polish business registry data.
- CEIDG API token (get it from dane.biznes.gov.pl in the API section).
Skill level: Beginner. You’ll connect credentials, create HubSpot properties, and map a few fields.
Don’t want to set this up yourself? Talk to an automation expert (free 15-minute consultation).
How It Works
A HubSpot company NIP changes. The workflow listens for updates to your “nip” property, so the automation only runs when it matters.
The NIP is checked before anything else happens. If the field is empty, the workflow stops and writes a note to the record so you can fix the input instead of wondering why enrichment didn’t run.
CEIDG is queried and the response is verified. n8n calls CEIDG with your API token, then confirms the response includes actual company data before moving forward.
HubSpot fields are filled automatically (or an error is flagged). A mapping step transforms CEIDG fields into your HubSpot properties, then the workflow updates the company record and logs issues to your notes property when something doesn’t match.
You can easily modify which HubSpot properties get updated and how strict the validation is based on your needs. See the full implementation guide below for customization options.
Step-by-Step Implementation Guide
Step 1: Configure the HubSpot Trigger
Set up the workflow to start when the NIP property changes in HubSpot companies.
- Add and configure NIP Property Change Trigger as the trigger node.
- Set Event to
company.propertyChangeand Property tonip. - Credential Required: Connect your HubSpot credentials for NIP Property Change Trigger.
Step 2: Connect the CEIDG Data Source
Fetch company data from the CEIDG API using the NIP value from HubSpot.
- Open Retrieve CEIDG Company Data and set URL to
=https://dane.biznes.gov.pl/api/ceidg/v3/firmy. - Enable Send Query and add a query parameter nip with value
{{ $json.propertyValue }}. - Set Authentication to
predefinedCredentialTypeand nodeCredentialType tohttpBearerAuth. - Credential Required: Connect your
httpBearerAuthcredentials for Retrieve CEIDG Company Data.
Step 3: Validate the NIP and Retrieved Data
Ensure the NIP exists before calling CEIDG and that the API returned a valid company record.
- In Validate NIP Presence, set the condition to check that value1 is not empty using
{{ $json.propertyValue }}. - Confirm that Validate NIP Presence routes the true path to Retrieve CEIDG Company Data and the false path to Flag HubSpot Record Error.
- In Confirm Data Retrieved, set the numeric condition to Left Value
{{ $json.count }}gt0. - Ensure Confirm Data Retrieved routes true to Map Data for HubSpot and false to Flag HubSpot Record Error.
count and that your API token has access.Step 4: Set Up the Data Mapping Logic
Transform CEIDG data into the property structure needed by HubSpot.
- Open Map Data for HubSpot and paste the provided JavaScript into JavaScript Code exactly as shown in the workflow.
- Verify the script reads the HubSpot payload using
$item(0).$node["NIP Property Change Trigger"].jsonto resolvecompanyId. - Confirm the output JSON includes the
propertiesobject with mapped fields likename,address, anddescription.
Step 5: Configure HubSpot Updates
Update the HubSpot company record with the enriched data and handle failures.
- In Modify HubSpot Company, set Resource to
companyand Operation toupdate. - Set Company ID to
{{ $('Validate NIP Presence').item.json.companyId }}. - Map the update fields using expressions, for example City
{{ $json.properties.city }}and Postal Code{{ $json.properties.zip }}. - In Custom Properties, set property to
ceidg_notesand value to{{ $json.properties.description }}. - Credential Required: Connect your HubSpot credentials for Modify HubSpot Company.
- In Flag HubSpot Record Error, set Company ID to
{{ $('Validate NIP Presence').item.json.companyId }}and update ceidg_notes to=Invalid NIP / No data found in CEIDG database. - Credential Required: Connect your HubSpot credentials for Flag HubSpot Record Error.
Step 6: Test and Activate Your Workflow
Validate end-to-end behavior before enabling production execution.
- Click Execute Workflow and trigger a NIP property change on a test company in HubSpot.
- Confirm the execution path follows NIP Property Change Trigger → Validate NIP Presence → Retrieve CEIDG Company Data → Confirm Data Retrieved → Map Data for HubSpot → Modify HubSpot Company.
- Verify successful updates in HubSpot (city, address, website, and
ceidg_notespopulated). - Test a missing or invalid NIP to ensure Flag HubSpot Record Error is executed and
ceidg_notesis updated. - When satisfied, toggle the workflow to Active for production use.
Common Gotchas
- HubSpot credentials can expire or need specific permissions. If things break, check your private app token access and the n8n HubSpot credential first.
- If you’re using Wait nodes or external rendering, processing times vary. Bump up the wait duration if downstream nodes fail on empty responses.
- CEIDG API responses can change shape or return “not found” for entities that aren’t in CEIDG. Make sure your “ceidg_notes” property is visible so reps see why enrichment failed.
Frequently Asked Questions
About 30 minutes if your HubSpot properties and CEIDG token are ready.
No. You’ll connect accounts and paste your CEIDG API token into n8n. The only “technical” part is checking the field mapping matches your HubSpot properties.
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 CEIDG API costs (often free or low-cost, depending on your plan).
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 common. You’ll adjust the mapping in the “Map Data for HubSpot” code step so additional CEIDG fields populate your chosen HubSpot properties. Many teams also tweak the validation so only empty fields get filled, which avoids overwriting existing account-owner edits. You can also change which property triggers the run if your NIP field uses a different internal name.
Usually it’s an expired or incorrect HubSpot private app token in n8n. Check the HubSpot credential in n8n first, then confirm the token has permission to read company changes and update company properties. If it works for some records but not others, you may be hitting property-level issues (like a missing “nip” property) or the workflow is writing to a property that doesn’t exist in that HubSpot portal.
A lot, as long as your CEIDG API plan and n8n execution limits allow it.
Often, yes, because this is more than a simple “lookup then update.” n8n makes it easy to add branching logic for validation, “found vs not found” handling, and field mapping without paying extra for multi-step paths. Self-hosting is also a big deal if you expect lots of company updates and don’t want per-task pricing. Zapier or Make can still work if you keep the logic minimal, but you’ll usually end up bolting on extra steps as soon as you want notes, stricter checks, or logging. Talk to an automation expert if you want help picking the simplest setup for your volume.
Once this is live, “add NIP” becomes the only manual step most teams need. The workflow keeps your HubSpot company records accurate so you can actually trust what you’re looking at.
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.