{
  "id": "S4eSrA9P5AIjbiGb",
  "name": "Enriching newly created HubSpot companies with Coresignal data",
  "tags": [],
  "nodes": [
    {
      "id": "0c47ea11-5619-4d8d-a660-3653091957fb",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        304,
        32
      ],
      "parameters": {
        "width": 480,
        "height": 640,
        "content": "## Enriching newly created HubSpot companies with Coresignal data\n\n### How it works\n\n1. Triggers when a new company is created in HubSpot.\n2. Waits to allow other HubSpot processes to finalize.\n3. Fetches newly created company details in HubSpot.\n4. Enriches the data using Coresignal based on the company's website URL.\n5. Updates the enriched information back into HubSpot.\n\n### Setup steps\n\n- [ ] Configure HubSpot credentials and connect the trigger node.\n- [ ] Set up Coresignal API credentials for enrichment.\n- [ ] Ensure permissible fields in HubSpot for data updates.\n\n### Customization\n\nYou can adjust the enrichment logic based on available data from Coresignal or add additional nodes to capture transformation logic before updating HubSpot."
      },
      "typeVersion": 1
    },
    {
      "id": "71b12395-6e86-48b7-ba0e-c3664f560012",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        864,
        32
      ],
      "parameters": {
        "color": 7,
        "width": 400,
        "height": 336,
        "content": "## Trigger and delay\n\nThis group monitors HubSpot for new company events and ensures there is some delay before fetching the company's information."
      },
      "typeVersion": 1
    },
    {
      "id": "6a657af3-52b2-4788-bea3-969cadc9dbe6",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1312,
        32
      ],
      "parameters": {
        "color": 7,
        "width": 608,
        "height": 336,
        "content": "## Fetch, enrich, and update\n\nThis group fetches the company information from HubSpot, enriches it using Coresignal data, and updates the company record back in HubSpot."
      },
      "typeVersion": 1
    },
    {
      "id": "c6a251ec-d022-4040-9939-a6b791da5d86",
      "name": "When Company Created in HubSpot",
      "type": "n8n-nodes-base.hubspotTrigger",
      "position": [
        912,
        192
      ],
      "parameters": {
        "eventsUi": {
          "eventValues": [
            {
              "name": "company.creation"
            }
          ]
        },
        "additionalFields": {}
      },
      "credentials": {
        "hubspotDeveloperApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "7e630504-8238-466e-9af6-2e742e37989f",
      "name": "Fetch Details from Coresignal",
      "type": "n8n-nodes-coresignal-api.coresignal",
      "position": [
        1552,
        192
      ],
      "parameters": {
        "resource": "company",
        "operation": "enrich",
        "websiteUrl": "={{ $json.properties.domain.value }}"
      },
      "credentials": {
        "coresignalApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "3a8a8b68-8885-4523-bdd5-792306a3f5f8",
      "name": "Update Company in HubSpot",
      "type": "n8n-nodes-base.hubspot",
      "position": [
        1776,
        192
      ],
      "parameters": {
        "resource": "company",
        "companyId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Retrieve Company from HubSpot').item.json.companyId }}"
        },
        "operation": "update",
        "updateFields": {
          "city": "={{ $json.hq_city }}",
          "description": "={{ $json.description_enriched }}",
          "numberOfEmployees": "={{ $json.employees_count }}",
          "linkedInCompanyPage": "={{ $json.linkedin_url }}"
        },
        "authentication": "oAuth2"
      },
      "credentials": {
        "hubspotOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "b1107fdf-69d5-41aa-aea7-cee560bc8d4a",
      "name": "Retrieve Company from HubSpot",
      "type": "n8n-nodes-base.hubspot",
      "position": [
        1360,
        192
      ],
      "parameters": {
        "resource": "company",
        "companyId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.companyId }}"
        },
        "operation": "get",
        "authentication": "oAuth2",
        "additionalFields": {}
      },
      "credentials": {
        "hubspotOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "c1922434-c429-4be9-9ce5-a6ed132e17ca",
      "name": "Wait 10 Seconds for Action",
      "type": "n8n-nodes-base.wait",
      "position": [
        1120,
        192
      ],
      "parameters": {
        "amount": 10
      },
      "typeVersion": 1.1
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "executionOrder": "v1"
  },
  "versionId": "95a269bc-a530-4d19-89d0-120345cff3e4",
  "connections": {
    "Wait 10 Seconds for Action": {
      "main": [
        [
          {
            "node": "Retrieve Company from HubSpot",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Details from Coresignal": {
      "main": [
        [
          {
            "node": "Update Company in HubSpot",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Retrieve Company from HubSpot": {
      "main": [
        [
          {
            "node": "Fetch Details from Coresignal",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When Company Created in HubSpot": {
      "main": [
        [
          {
            "node": "Wait 10 Seconds for Action",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}