ポーランドの NIP による HubSpot 企業情報の自動入力
中級
これはLead Generation分野の自動化ワークフローで、15個のノードを含みます。主にIf, Code, Hubspot, HttpRequest, HubspotTriggerなどのノードを使用。 NIP 識別子を使用してポーランド CEIDG データで HubSpot 企業情報を充実させる
前提条件
- •HubSpot API Key
- •ターゲットAPIの認証情報が必要な場合あり
カテゴリー
ワークフロープレビュー
ノード接続関係を可視化、ズームとパンをサポート
ワークフローをエクスポート
以下のJSON設定をn8nにインポートして、このワークフローを使用できます
{
"id": "KifsNxjgoHTGzDxt",
"meta": {
"instanceId": "a244e08ca65e768d1cee097a486ef066f1968b077e055f21a34efe4e78c40e76"
},
"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": "NIPが存在するか確認",
"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": "NIPプロパティ変更時",
"type": "n8n-nodes-base.hubspotTrigger",
"position": [
-96,
432
],
"webhookId": "7a4af938-f0f4-49cb-84f1-de35a042d791",
"parameters": {
"eventsUi": {
"eventValues": [
{
"name": "company.propertyChange",
"property": "nip"
}
]
},
"additionalFields": {}
},
"typeVersion": 1
},
{
"id": "d1ace6e8-5170-4093-94cc-04662969523b",
"name": "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": "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": "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 → NIP/REGON\nconst owner = company.wlasciciel || {};\nconst nip = owner.nip || '';\nconst regon = owner.regon || '';\n\n// Return format ready for HubSpot Company → 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 || '—'}, REGON: ${regon || '—'}. Start: ${company.dataRozpoczecia || 'N/A'}`,\n },\n },\n};"
},
"typeVersion": 2
},
{
"id": "03b138e2-84c9-4fcd-87b3-34e97a639484",
"name": "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": "データ取得の確認",
"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": "ワークフロー説明",
"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": "ステップ1: HubSpot トリガー",
"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": "ステップ2: 入力検証",
"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": "ステップ3: データ取得",
"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": "ステップ4: 応答確認",
"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": "ステップ5: フィールドマッピング",
"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": "ステップ6: 更新成功",
"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": "エラー処理",
"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,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "5599e99c-c3b9-4cc1-97a8-0af7dee05ac0",
"connections": {
"538bb51e-c5dd-4173-b0ca-a13934985a72": {
"main": [
[
{
"node": "183aaa16-4d06-44c6-86a0-19b7332bf565",
"type": "main",
"index": 0
}
],
[
{
"node": "03b138e2-84c9-4fcd-87b3-34e97a639484",
"type": "main",
"index": 0
}
]
]
},
"641f0344-7de8-46de-b7ea-29a67c1b1946": {
"main": [
[
{
"node": "6abd961a-2c92-44dc-96a6-cf094b36e01a",
"type": "main",
"index": 0
}
],
[
{
"node": "03b138e2-84c9-4fcd-87b3-34e97a639484",
"type": "main",
"index": 0
}
]
]
},
"6f3002a3-ba7f-43f0-801c-9aac9d30e538": {
"main": [
[
{
"node": "538bb51e-c5dd-4173-b0ca-a13934985a72",
"type": "main",
"index": 0
}
]
]
},
"6abd961a-2c92-44dc-96a6-cf094b36e01a": {
"main": [
[
{
"node": "d1ace6e8-5170-4093-94cc-04662969523b",
"type": "main",
"index": 0
}
]
]
},
"183aaa16-4d06-44c6-86a0-19b7332bf565": {
"main": [
[
{
"node": "641f0344-7de8-46de-b7ea-29a67c1b1946",
"type": "main",
"index": 0
}
]
]
}
}
}よくある質問
このワークフローの使い方は?
上記のJSON設定コードをコピーし、n8nインスタンスで新しいワークフローを作成して「JSONからインポート」を選択、設定を貼り付けて認証情報を必要に応じて変更してください。
このワークフローはどんな場面に適していますか?
中級 - リード獲得
有料ですか?
このワークフローは完全無料です。ただし、ワークフローで使用するサードパーティサービス(OpenAI APIなど)は別途料金が発生する場合があります。
関連ワークフロー
URLベースでAI、Telegram、マルチプラットフォームで自動のにソーシャルメディア投稿を生成
URLを基にAI、Telegram、複数のプラットフォームで自動のにソーシャルメディア投稿を作成
If
Set
Code
+
If
Set
Code
42 ノードKarol
コンテンツ作成
RSSをFacebookおよびInstagramに公開
AIによる要約と画像生成を使ったRSSからソーシャルメディアへの自動公開
If
Set
Code
+
If
Set
Code
34 ノードKarol
コンテンツ作成
HubSpot、Clearbit、Slackを基に据えた自動化リードキャプチャ、スコアリング、CRM統合
HubSpot、Clearbit、Slack を基にした自動リードキャプチャ、スコアリングおよび CRM 統合
If
Code
Merge
+
If
Code
Merge
22 ノードshae
リード獲得
N8N ワークフロー:購入層の追加
Surfe と Google Sheets を使用して、HubSpot 購入グループを自動のに検出して強化します
If
Code
Wait
+
If
Code
Wait
22 ノードgo-surfe
リード獲得
連絡先情報の充実
HubSpot用の、Apollo・LinkedIn・GPT-4oを基にした完全なコンタクト enrichment
If
Set
Code
+
If
Set
Code
24 ノードInterlock GTM
リード獲得
Google スプレッドシートからマーケティングリードを豊富にする
🚀 Surfe、Google Sheets、HubSpot を使った LinkedIn 連絡先情報の充実自動化
If
Code
Wait
+
If
Code
Wait
12 ノードgo-surfe
リード獲得