{
  "id": "roTluFxN62nDtIWV",
  "name": "Enrich existing HubSpot company records with Veridion",
  "tags": [
    {
      "id": "B6QqFaNPxXj6L3P5",
      "name": "veridion",
      "createdAt": "2026-06-10T11:27:40.742Z",
      "updatedAt": "2026-06-10T11:27:40.742Z"
    },
    {
      "id": "BnMkEkhKaUFO4VTE",
      "name": "hubspot",
      "createdAt": "2026-06-10T11:27:40.770Z",
      "updatedAt": "2026-06-10T11:27:40.770Z"
    },
    {
      "id": "O6RKwaphX4JXeHfk",
      "name": "enrichment",
      "createdAt": "2026-06-10T11:27:40.778Z",
      "updatedAt": "2026-06-10T11:27:40.778Z"
    },
    {
      "id": "WcJwBQjBRl2NgStp",
      "name": "crm",
      "createdAt": "2026-06-10T11:27:40.773Z",
      "updatedAt": "2026-06-10T11:27:40.773Z"
    }
  ],
  "nodes": [
    {
      "id": "5c827d9f-b6ba-40e0-9369-f6fa994a6442",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2864,
        2320
      ],
      "parameters": {
        "width": 480,
        "height": 640,
        "content": "## Enrich existing HubSpot company records with Veridion\n\n### How it works\n\n1. The workflow starts manually and retrieves companies from HubSpot.\n2. Only companies that are not yet enriched are selected.\n3. Details of each selected company are fetched.\n4. The Veridion API is used to enrich company details.\n5. If a match is found, the enriched details are mapped and updated back into HubSpot.\n\n### Setup steps\n\n- [ ] Configure HubSpot credentials to allow the fetching and updating of company records.\n- [ ] Set up Veridion API credentials for company enrichment.\n\n### Customization\n\nYou can customize the fields to map from Veridion to HubSpot based on your specific data requirements."
      },
      "typeVersion": 1
    },
    {
      "id": "6ec35558-9908-41da-b022-020f7d3aa457",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3424,
        2416
      ],
      "parameters": {
        "color": 7,
        "width": 416,
        "height": 304,
        "content": "## Trigger and retrieve companies\n\nInitiates the workflow and fetches companies from HubSpot."
      },
      "typeVersion": 1
    },
    {
      "id": "1a64da83-4e2a-4d96-8d82-f32dad004f7a",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3872,
        2352
      ],
      "parameters": {
        "color": 7,
        "width": 240,
        "height": 352,
        "content": "## Filter unenriched companies\n\nKeeps only those company records that haven't been enriched yet."
      },
      "typeVersion": 1
    },
    {
      "id": "490e4fdf-db3b-4ad1-bf43-f2f15faa6050",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4144,
        2416
      ],
      "parameters": {
        "color": 7,
        "width": 416,
        "height": 304,
        "content": "## Fetch details and enrich\n\nGets details of selected companies and sends them to Veridion for enrichment."
      },
      "typeVersion": 1
    },
    {
      "id": "b1b9539f-6e29-44b3-80e5-1b649f81841b",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4592,
        2320
      ],
      "parameters": {
        "color": 7,
        "width": 640,
        "height": 496,
        "content": "## Conditional mapping and updating\n\nDetermines if a match is found and updates HubSpot accordingly or skips if no match is found."
      },
      "typeVersion": 1
    },
    {
      "id": "fcd05262-4e32-4d8c-af06-28434c229989",
      "name": "Manual Start Process",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        3472,
        2544
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "b4489daf-fafd-486d-85fd-e2b0d2c823d7",
      "name": "Retrieve HubSpot Companies",
      "type": "n8n-nodes-base.hubspot",
      "position": [
        3696,
        2544
      ],
      "parameters": {
        "options": {
          "propertiesCollection": {
            "propertiesValues": {
              "properties": [
                "veridion_enriched",
                "veridion_industry",
                "name",
                "domain",
                "phone"
              ]
            }
          }
        },
        "resource": "company",
        "operation": "getAll",
        "authentication": "appToken"
      },
      "credentials": {
        "hubspotAppToken": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "7778ac45-8035-49b2-bd32-393d076a622a",
      "name": "Fetch Company Details",
      "type": "n8n-nodes-base.hubspot",
      "position": [
        4192,
        2544
      ],
      "parameters": {
        "resource": "company",
        "companyId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.companyId || $json.id || $json.properties?.hs_object_id?.value || $json.properties?.hs_object_id }}"
        },
        "operation": "get",
        "authentication": "appToken",
        "additionalFields": {}
      },
      "credentials": {
        "hubspotAppToken": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "8b8b84cf-e770-4d35-9b5f-de70eb9d45c8",
      "name": "Enrich with Veridion",
      "type": "n8n-nodes-veridion.veridion",
      "position": [
        4416,
        2544
      ],
      "parameters": {
        "website": "={{ $json.properties?.domain?.value || $json.properties?.domain || $json.properties?.website?.value || $json.properties?.website || $json.domain || $json.website }}",
        "phoneNumber": "={{ $json.properties?.phone?.value || $json.properties?.phone || '' }}",
        "commercialName": "={{ $json.properties?.name?.value || $json.properties?.name || $json.name }}"
      },
      "credentials": {
        "veridionApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "064cc8e4-cfca-449f-b79c-bd6821e7b609",
      "name": "Check for Match",
      "type": "n8n-nodes-base.if",
      "position": [
        4640,
        2544
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "leftValue": "",
            "caseSensitive": false,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "c1",
              "operator": {
                "type": "boolean",
                "operation": "notEquals"
              },
              "leftValue": "={{ $json.matched }}",
              "rightValue": false
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "606cd973-1c87-4c51-ab11-d0da69c5d1f1",
      "name": "Map Veridion to HubSpot Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        4864,
        2448
      ],
      "parameters": {
        "fields": {
          "values": [
            {
              "name": "veridion_industry",
              "stringValue": "={{ $json.main_industry }}"
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "d86a0f3f-c904-437f-be57-bc4974698e93",
      "name": "Update Company in HubSpot",
      "type": "n8n-nodes-base.hubspot",
      "position": [
        5088,
        2448
      ],
      "parameters": {
        "resource": "company",
        "companyId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Fetch Company Details').item.json.companyId || $('Fetch Company Details').item.json.id || $('Fetch Company Details').item.json.properties?.hs_object_id?.value || $('Fetch Company Details').item.json.properties?.hs_object_id }}"
        },
        "operation": "update",
        "updateFields": {
          "city": "={{ $json.main_address.city }}",
          "description": "={{ $json.short_description }}",
          "phoneNumber": "={{ $json.primary_phone }}",
          "yearFounded": "={{ $json.year_founded }}",
          "annualRevenue": "={{ $json.revenue.value }}",
          "countryRegion": "={{ $json.main_address.country_code }}",
          "numberOfEmployees": "={{ $json.employee_count.value }}",
          "customPropertiesUi": {
            "customPropertiesValues": [
              {
                "value": "={{ $json.veridion_industry }}",
                "property": "veridion_industry"
              },
              {
                "value": "true",
                "property": "veridion_enriched"
              }
            ]
          },
          "linkedInCompanyPage": "={{ $json.linkedin_url }}"
        },
        "authentication": "appToken"
      },
      "credentials": {
        "hubspotAppToken": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "1295e1cc-6fcf-4bce-acaa-0418660d1f79",
      "name": "Skip if No Match",
      "type": "n8n-nodes-base.noOp",
      "position": [
        4864,
        2640
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "10b995e9-a55a-4bca-957a-e724c9735012",
      "name": "Filter Non-Enriched Companies",
      "type": "n8n-nodes-base.code",
      "position": [
        3920,
        2544
      ],
      "parameters": {
        "jsCode": "const output = [];\n\nfor (const item of items) {\n  const props = item.json.properties || {};\n\n  if (!Object.prototype.hasOwnProperty.call(props, 'veridion_enriched')) {\n    throw new Error(\n      'Missing HubSpot property \"veridion_enriched\" in the company payload. Create this Company property in HubSpot and make sure the \"Get HubSpot companies\" node requests it under Options > Properties before running enrichment.'\n    );\n  }\n\n  const raw = props.veridion_enriched?.value ?? props.veridion_enriched;\n  const isEnriched = raw === true || raw === 'true';\n\n  if (!isEnriched) {\n    output.push(item);\n  }\n}\n\nreturn output;"
      },
      "typeVersion": 2
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "executionOrder": "v1"
  },
  "versionId": "1f00ba48-ec96-416c-9a62-360cbc144a27",
  "connections": {
    "Check for Match": {
      "main": [
        [
          {
            "node": "Map Veridion to HubSpot Fields",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Skip if No Match",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Enrich with Veridion": {
      "main": [
        [
          {
            "node": "Check for Match",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Manual Start Process": {
      "main": [
        [
          {
            "node": "Retrieve HubSpot Companies",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Company Details": {
      "main": [
        [
          {
            "node": "Enrich with Veridion",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Retrieve HubSpot Companies": {
      "main": [
        [
          {
            "node": "Filter Non-Enriched Companies",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Non-Enriched Companies": {
      "main": [
        [
          {
            "node": "Fetch Company Details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Map Veridion to HubSpot Fields": {
      "main": [
        [
          {
            "node": "Update Company in HubSpot",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}