This workflow corresponds to n8n.io template #10125 — we link there as the canonical source.
This workflow follows the HTTP Request → HubSpot recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"id": "KifsNxjgoHTGzDxt",
"name": "Auto-populate HubSpot company from Polish NIP",
"tags": [
{
"id": "AOZlNztgqiOQKd6j",
"name": "n8n Creators",
"createdAt": "2025-09-28T11:02:15.227Z",
"updatedAt": "2025-09-28T11:02:15.227Z"
}
],
"nodes": [
{
"id": "538bb51e-c5dd-4173-b0ca-a13934985a72",
"name": "Check if NIP exists",
"type": "n8n-nodes-base.if",
"position": [
128,
432
],
"parameters": {
"options": {},
"conditions": {
"string": [
{
"value1": "={{ $json.propertyValue }}",
"operation": "isNotEmpty"
}
]
}
},
"typeVersion": 2
},
{
"id": "6f3002a3-ba7f-43f0-801c-9aac9d30e538",
"name": "When NIP property changes",
"type": "n8n-nodes-base.hubspotTrigger",
"position": [
-96,
432
],
"parameters": {
"eventsUi": {
"eventValues": [
{
"name": "company.propertyChange",
"property": "nip"
}
]
},
"additionalFields": {}
},
"typeVersion": 1
},
{
"id": "d1ace6e8-5170-4093-94cc-04662969523b",
"name": "Update company in HubSpot",
"type": "n8n-nodes-base.hubspot",
"position": [
1056,
304
],
"parameters": {
"resource": "company",
"companyId": {
"__rl": true,
"mode": "id",
"value": "={{ $('Check if NIP exists').item.json.companyId }}"
},
"operation": "update",
"updateFields": {
"city": "={{ $json.properties.city }}",
"name": "={{ $json.properties.name }}",
"postalCode": "={{ $json.properties.zip }}",
"websiteUrl": "={{ $json.properties.website }}",
"phoneNumber": "={{ $json.properties.phone }}",
"stateRegion": "={{ $json.properties.state }}",
"countryRegion": "={{ $json.properties.country }}",
"streetAddress": "={{ $json.properties.address }}",
"customPropertiesUi": {
"customPropertiesValues": [
{
"value": "={{ $json.properties.description }}",
"property": "ceidg_notes"
}
]
}
},
"authentication": "appToken"
},
"typeVersion": 2.2
},
{
"id": "183aaa16-4d06-44c6-86a0-19b7332bf565",
"name": "Fetch company data from CEIDG",
"type": "n8n-nodes-base.httpRequest",
"onError": "continueRegularOutput",
"position": [
352,
320
],
"parameters": {
"url": "=https://dane.biznes.gov.pl/api/ceidg/v3/firmy",
"options": {},
"sendQuery": true,
"authentication": "predefinedCredentialType",
"queryParameters": {
"parameters": [
{
"name": "nip",
"value": "={{ $json.propertyValue }}"
}
]
},
"nodeCredentialType": "httpBearerAuth"
},
"typeVersion": 4.2,
"alwaysOutputData": true
},
{
"id": "6abd961a-2c92-44dc-96a6-cf094b36e01a",
"name": "Transform data for HubSpot",
"type": "n8n-nodes-base.code",
"position": [
816,
304
],
"parameters": {
"jsCode": "// Input: single item from \"Fetch company data from CEIDG\" node (CEIDG v3 API)\n// Structure: { firmy: [ { nazwa, adresDzialalnosci:{...}, wlasciciel:{ nip, regon }, ... } ], ... }\n\nconst data = $input.item.json;\n\n// Validation\nif (!data || !Array.isArray(data.firmy) || data.firmy.length === 0) {\n throw new Error('No company found in CEIDG response');\n}\n\n// First company from the list\nconst company = data.firmy[0];\n\n// Get companyId from HubSpot Trigger\nconst hubspotPayload = $item(0).$node[\"When NIP property changes\"].json;\nconst companyId = hubspotPayload.companyid || hubspotPayload.objectId;\n\n// CEIDG v3: address is in \"adresDzialalnosci\"\nconst addr = company.adresDzialalnosci || {};\n\nconst street = [\n addr.ulica,\n addr.budynek,\n addr.lokal ? `/${addr.lokal}` : ''\n]\n.filter(Boolean)\n.join(' ');\n\n// Owner \u2192 NIP/REGON\nconst owner = company.wlasciciel || {};\nconst nip = owner.nip || '';\nconst regon = owner.regon || '';\n\n// Return format ready for HubSpot Company \u2192 Update\nreturn {\n json: {\n companyId: companyId,\n properties: {\n name: company.nazwa || '',\n address: street || '',\n city: addr.miasto || '',\n zip: addr.kod || '',\n state: addr.wojewodztwo || '',\n country: 'Poland',\n phone: company.telefon || '',\n website: company.www || '',\n description: `Auto-populated from CEIDG. NIP: ${nip || '\u2014'}, REGON: ${regon || '\u2014'}. Start: ${company.dataRozpoczecia || 'N/A'}`,\n },\n },\n};"
},
"typeVersion": 2
},
{
"id": "03b138e2-84c9-4fcd-87b3-34e97a639484",
"name": "Mark error in HubSpot",
"type": "n8n-nodes-base.hubspot",
"position": [
1056,
896
],
"parameters": {
"resource": "company",
"companyId": {
"__rl": true,
"mode": "id",
"value": "={{ $('Check if NIP exists').item.json.companyId }}"
},
"operation": "update",
"updateFields": {
"customPropertiesUi": {
"customPropertiesValues": [
{
"value": "=Invalid NIP / No data found in CEIDG database",
"property": "ceidg_notes"
}
]
}
},
"authentication": "appToken"
},
"typeVersion": 2.2
},
{
"id": "641f0344-7de8-46de-b7ea-29a67c1b1946",
"name": "Check if data retrieved",
"type": "n8n-nodes-base.if",
"position": [
576,
320
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "05aca5e7-3131-4e58-9e38-a5caa08f93a9",
"operator": {
"type": "number",
"operation": "gt"
},
"leftValue": "={{ $json.count }}",
"rightValue": 0
}
]
}
},
"typeVersion": 2.2
},
{
"id": "52855cc7-4754-4582-b0ef-803f31f9db06",
"name": "Workflow Description",
"type": "n8n-nodes-base.stickyNote",
"position": [
-880,
-64
],
"parameters": {
"color": 4,
"width": 678.2462538708118,
"height": 1181.1692474064032,
"content": "## Auto-populate HubSpot company from Polish NIP\n\nThis workflow automatically enriches HubSpot company records with official data from the Polish CEIDG (Central Register and Information on Economic Activity) database when a NIP (Polish Tax ID) is added or updated.\n\n## Who's it for\n\nPolish sales teams, marketing agencies, and CRM administrators who work with Polish companies in HubSpot and want to save time on manual data entry while ensuring data accuracy.\n\n## How it works\n\n1. **Trigger**: Monitors HubSpot for changes to the \"NIP\" property on company records\n2. **Validation**: Checks if the NIP field is not empty\n3. **API Query**: Fetches official company data from the Polish CEIDG database using the provided NIP\n4. **Data Check**: Verifies if company data was successfully retrieved\n5. **Transform**: Maps CEIDG data to HubSpot company properties\n6. **Update**: Enriches the HubSpot company record with:\n - Company name\n - Full address (street, city, postal code, state)\n - Phone number\n - Website URL\n - NIP and REGON numbers\n - Business start date\n7. **Error Handling**: If NIP is invalid or no data found, adds a note to the company record\n\n## Requirements\n\n- **HubSpot account** with:\n - Custom property \"nip\" created for companies\n - Custom property \"ceidg_notes\" created for companies (optional, for storing API notes)\n - App token or developer API credentials\n- **CEIDG API Token** (free registration at https://dane.biznes.gov.pl/)\n- **n8n instance** (self-hosted or cloud)\n\n## How to set up\n\n1. **Create HubSpot custom properties**:\n - Go to HubSpot Settings > Properties > Company Properties\n - Create a \"nip\" property (single-line text)\n - Create a \"ceidg_notes\" property (multi-line text) for storing API responses\n\n2. **Get CEIDG API Token**:\n - Register at https://dane.biznes.gov.pl/\n - Navigate to API section and generate your token\n - Add token to n8n credentials (HTTP Bearer YOUR_TOKEN_HERE)\n\n3. **Configure HubSpot credentials**:\n - Add your HubSpot App Token in n8n credentials\n - Or use HubSpot Developer API credentials\n\n4. **Activate the workflow**:\n - Import this workflow to your n8n instance\n - Configure the credentials in all HubSpot and HTTP nodes\n - Activate the workflow\n\n5. **Test**:\n - Add or update a NIP value in any HubSpot company record\n - Check if the company data gets automatically populated\n\n## How to customize\n\n- **Add more fields**: Modify the \"Transform data for HubSpot\" Code node to map additional CEIDG fields\n- **Change trigger property**: Update the HubSpot Trigger to monitor a different property name\n- **Notification**: Add an email or Slack notification node after successful updates\n- **Batch processing**: Add a schedule trigger to process multiple companies at once\n- **Data validation**: Add nodes to validate NIP format before making the API call\n- **Logging**: Add a Google Sheets or database node to log all enrichment activities\n\n## Notes\n\n- CEIDG database contains data for sole proprietorships registered in Poland\n- For limited liability companies (sp. z o.o.) and other entities, you'll need to use KRS (National Court Register) API instead\n- The workflow processes one company at a time as they are updated\n- API rate limits apply based on your CEIDG API plan"
},
"typeVersion": 1
},
{
"id": "3104719e-08b1-4a4a-916e-11976d4ea6ed",
"name": "Step 1: HubSpot Trigger",
"type": "n8n-nodes-base.stickyNote",
"position": [
-160,
80
],
"parameters": {
"width": 217,
"height": 525,
"content": "## Trigger\n\nMonitors HubSpot for changes to the NIP property on company records.\n\nWhen a NIP is added or updated, the workflow starts automatically."
},
"typeVersion": 1
},
{
"id": "a8758064-a305-4d97-9481-406261c56462",
"name": "Step 2: Validate Input",
"type": "n8n-nodes-base.stickyNote",
"position": [
80,
80
],
"parameters": {
"width": 201,
"height": 525,
"content": "## Validation\n\nChecks if the NIP field has a value.\n\nIf empty, the workflow ends here to avoid unnecessary API calls."
},
"typeVersion": 1
},
{
"id": "cdcc5ce1-0b8b-4243-817c-fe5521273dad",
"name": "Step 3: Fetch Data",
"type": "n8n-nodes-base.stickyNote",
"position": [
304,
-32
],
"parameters": {
"width": 201,
"height": 525,
"content": "## CEIDG API Query\n\nFetches official company data from the Polish government database.\n\nRequires a free API token from dane.biznes.gov.pl"
},
"typeVersion": 1
},
{
"id": "eb23700a-c13a-4a0b-aadc-374b4558259c",
"name": "Step 4: Verify Response",
"type": "n8n-nodes-base.stickyNote",
"position": [
528,
-32
],
"parameters": {
"width": 201,
"height": 525,
"content": "## Data Verification\n\nChecks if the API returned any company records.\n\nIf count > 0, proceeds to update HubSpot.\nIf count = 0, marks an error."
},
"typeVersion": 1
},
{
"id": "d176a34a-25db-46d9-9605-9111608faf53",
"name": "Step 5: Map Fields",
"type": "n8n-nodes-base.stickyNote",
"position": [
752,
-32
],
"parameters": {
"width": 217,
"height": 525,
"content": "## Transform Data\n\nMaps CEIDG API response to HubSpot company properties.\n\nExtracts:\n- Company name\n- Address components\n- Contact details\n- NIP/REGON numbers"
},
"typeVersion": 1
},
{
"id": "97f97f48-e594-4a81-a97f-827434f46ff1",
"name": "Step 6: Update Success",
"type": "n8n-nodes-base.stickyNote",
"position": [
992,
-32
],
"parameters": {
"width": 265,
"height": 525,
"content": "## Success Path\n\nUpdates the HubSpot company record with all enriched data from CEIDG.\n\nIncludes company name, address, phone, website, and notes."
},
"typeVersion": 1
},
{
"id": "5daf227a-3112-4812-9d92-442ec883d08b",
"name": "Error Handling",
"type": "n8n-nodes-base.stickyNote",
"position": [
992,
528
],
"parameters": {
"width": 265,
"height": 525,
"content": "## Error Path\n\nIf NIP is invalid or not found in CEIDG, this node adds a note to the HubSpot company.\n\nHelps identify problematic records."
},
"typeVersion": 1
}
],
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "5599e99c-c3b9-4cc1-97a8-0af7dee05ac0",
"connections": {
"Check if NIP exists": {
"main": [
[
{
"node": "Fetch company data from CEIDG",
"type": "main",
"index": 0
}
],
[
{
"node": "Mark error in HubSpot",
"type": "main",
"index": 0
}
]
]
},
"Check if data retrieved": {
"main": [
[
{
"node": "Transform data for HubSpot",
"type": "main",
"index": 0
}
],
[
{
"node": "Mark error in HubSpot",
"type": "main",
"index": 0
}
]
]
},
"When NIP property changes": {
"main": [
[
{
"node": "Check if NIP exists",
"type": "main",
"index": 0
}
]
]
},
"Transform data for HubSpot": {
"main": [
[
{
"node": "Update company in HubSpot",
"type": "main",
"index": 0
}
]
]
},
"Fetch company data from CEIDG": {
"main": [
[
{
"node": "Check if data retrieved",
"type": "main",
"index": 0
}
]
]
}
}
}
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
This workflow automatically enriches HubSpot company records with official data from the Polish CEIDG (Central Register and Information on Economic Activity) database when a NIP (Polish Tax ID) is added or updated.
Source: https://n8n.io/workflows/10125/ — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
This workflow aims to enrich new contacts in HubSpot. The more relevant the HubSpot profile, the more useful it is. Once active, this n8n workflow will update the social profiles, contact data (phone,
This template syncs prospects from ProspectPro into HubSpot. It checks if a company already exists in HubSpot (by ProspectPro ID or domain), then updates the record or creates a new one. Sync results
This workflow retrieves contacts from HubSpot that have an email address but haven't yet had their email validated by Hunter. It then iterates through each of these contacts, uses Hunter.io to verify
This workflow allows you to import any workflow from a file or another n8n instance and map the credentials easily. A multi-form setup guides you through the entire process At the beginning you have t
[n8n] Advanced URL Parsing and Shortening Workflow - Switchy.io Integration. Uses splitInBatches, stickyNote, httpRequest, html. Event-driven trigger; 56 nodes.