{
  "id": "nchDUZDqatT6rKRA",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Automate Company Data Enrichment with HubSpot, Sona & Google Sheets",
  "tags": [],
  "nodes": [
    {
      "id": "cfff738f-c6dc-48cc-8471-035903590453",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1152,
        -32
      ],
      "parameters": {
        "color": 6,
        "width": 560,
        "height": 736,
        "content": "# Enrich Companies from Google Sheets to HubSpot with Sona\n\n## \u2705 Setup Requirements\n\n**Before running this workflow, you need:**\n\n1. **Google Sheets** with a column named `Website Domain`\n   - Add company websites (e.g., `example.com`)\n\n2. **HubSpot Account & App Token**\n   - Get an app token from HubSpot by creating a legacy app:\n     - Go to HubSpot **Settings** > **Integrations** > **Legacy Apps**\n     - Click **Create Legacy App**\n     - Select **Private** (for one account)\n     - In the scopes section, enable the following permissions:\n       - `crm.schemas.companies.write`\n       - `crm.objects.companies.write`\n       - `crm.schemas.companies.read`\n     - Click **Create**\n     - Copy the access token from the **Auth** tab\n\n3. **Sona API Key** (for company enrichment)\n   - Sign up at https://app.sonalabs.com\n   - Free tier available for testing\n\n**\ud83d\udccb Output:** Company records in HubSpot with firmographic data (revenue, employees, location, description, etc.)"
      },
      "typeVersion": 1
    },
    {
      "id": "6f320dee-168e-4ec6-b1f9-3b50cceb390a",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -576,
        -32
      ],
      "parameters": {
        "color": 4,
        "width": 496,
        "height": 448,
        "content": "## \ud83d\udce5 Step 1: Get Company List\n\n**What happens here:**\n- Reads company domains from Google Sheets\n- Aggregates all domains into a single array\n- Prepares data for batch processing"
      },
      "typeVersion": 1
    },
    {
      "id": "048d6f42-3aeb-44ae-aba2-be2bbfada1c2",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -64,
        -32
      ],
      "parameters": {
        "color": 3,
        "width": 496,
        "height": 448,
        "content": "## \u2699\ufe0f Step 2: Setup HubSpot Fields\n\n**What happens here:**\n- Creates custom Sona fields in HubSpot CRM\n- Defines all enrichment data fields"
      },
      "typeVersion": 1
    },
    {
      "id": "47214215-00ee-4f77-be3e-c44d1c8a2575",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -576,
        432
      ],
      "parameters": {
        "color": 7,
        "width": 496,
        "height": 1024,
        "content": "## \ud83d\udd04 Step 3: Prepare for Processing\n\n**What happens here:**\n- Converts aggregated domains into individual items\n- Splits data for batch loop processing\n- Ready for enrichment"
      },
      "typeVersion": 1
    },
    {
      "id": "5b1eaf38-0ff8-4bc3-9f34-092f352f2908",
      "name": "Sona Enrich",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        256,
        816
      ],
      "parameters": {
        "url": "https://api2.sonalabs.com/resource/company/enrich",
        "options": {
          "timeout": 50000,
          "batching": {
            "batch": {
              "batchSize": 1,
              "batchInterval": 3000
            }
          },
          "response": {
            "response": {
              "neverError": true
            }
          }
        },
        "sendQuery": true,
        "sendHeaders": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "website",
              "value": "={{ $json.domains.toLowerCase().endsWith('.com') ? $json.domains.toLowerCase() : $json.domains.toLowerCase() + '.com' }}"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "x-api-key"
            },
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        }
      },
      "typeVersion": 4.2,
      "alwaysOutputData": false
    },
    {
      "id": "3c3eed25-c652-426a-8e8e-0c84186dc08f",
      "name": "Get Company List from Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -368,
        224
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1qUir1c-_YOUR_AWS_SECRET_KEY_HERE#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1qUir1c-_ScMnoYVoQ0W41nsv5IpLW6rjK8HUNqvNnAg",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1qUir1c-_YOUR_AWS_SECRET_KEY_HERE?usp=drivesdk",
          "cachedResultName": "example"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "4026e26d-34d8-406b-9278-63a681970b89",
      "name": "Start",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -544,
        224
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "5226d23c-6153-43e0-9528-553be5f93370",
      "name": "Create HubSpot Company",
      "type": "n8n-nodes-base.hubspot",
      "position": [
        48,
        1024
      ],
      "parameters": {
        "name": "={{ $json.data.name }}",
        "resource": "company",
        "authentication": "appToken",
        "additionalFields": {
          "city": "={{ $json.data.city || 'none' }}",
          "timezone": "={{ $json.data.timezone || 'none' }}",
          "postalCode": "={{ $json.data.postalCode || 0 }}",
          "websiteUrl": "={{ $json.data.website || 'none' }}",
          "description": "={{ $json.data.description || 'none' }}",
          "phoneNumber": "={{ $json.data.phone || 0 }}",
          "stateRegion": "={{ $json.data.state || 'none' }}",
          "yearFounded": "={{ $json.data.founded || 0 }}",
          "annualRevenue": "={{ $json.data.annualRevenue || 0 }}",
          "countryRegion": "={{ $json.data.country || 'none' }}",
          "streetAddress": "={{ $json.data.streetAddress || 'none' }}",
          "twitterHandle": "={{ $json.data.twitterUrl || 'none' }}",
          "companyDomainName": "={{ $('Loop Through Companies').first().json.domains || none }}",
          "numberOfEmployees": "={{ $json.data.employees || 0 }}"
        }
      },
      "credentials": {
        "hubspotAppToken": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "1756dfb9-4bb2-413a-a971-dcbb347cf334",
      "name": "Create Custom HubSpot Fields",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        128,
        240
      ],
      "parameters": {
        "url": "https://api.hubapi.com/YOUR_AWS_SECRET_KEY_HERE",
        "method": "POST",
        "options": {},
        "jsonBody": "{\n  \"inputs\": [\n    {\n      \"name\": \"industry\",\n      \"label\": \"Sona: Industry\",\n      \"type\": \"string\",\n      \"fieldType\": \"text\",\n      \"groupName\": \"companyinformation\"\n    },\n    {\n      \"name\": \"tech\",\n      \"label\": \"Sona: Tech\",\n      \"type\": \"string\",\n      \"fieldType\": \"textarea\",\n      \"groupName\": \"companyinformation\"\n    },\n    {\n      \"name\": \"tech_categories\",\n      \"label\": \"Sona: Tech Categories\",\n      \"type\": \"string\",\n      \"fieldType\": \"textarea\",\n      \"groupName\": \"companyinformation\"\n    },\n    {\n      \"name\": \"min_estimated_annual_revenue\",\n      \"label\": \"Sona: Min Estimated Annual Revenue\",\n      \"type\": \"string\",\n      \"fieldType\": \"text\",\n      \"groupName\": \"companyinformation\"\n    },\n    {\n      \"name\": \"max_estimated_annual_revenue\",\n      \"label\": \"Sona: Max Estimated Annual Revenue\",\n      \"type\": \"string\",\n      \"fieldType\": \"text\",\n      \"groupName\": \"companyinformation\"\n    },\n    {\n      \"name\": \"sub_industry\",\n      \"label\": \"Sona: Sub Industry\",\n      \"type\": \"string\",\n      \"fieldType\": \"text\",\n      \"groupName\": \"companyinformation\"\n    },\n    {\n      \"name\": \"lat\",\n      \"label\": \"Sona: Latitude\",\n      \"type\": \"string\",\n      \"fieldType\": \"text\",\n      \"groupName\": \"companyinformation\"\n    },\n    {\n      \"name\": \"lng\",\n      \"label\": \"Sona: Longitude\",\n      \"type\": \"string\",\n      \"fieldType\": \"text\",\n      \"groupName\": \"companyinformation\"\n    },\n    {\n      \"name\": \"logo\",\n      \"label\": \"Sona: Logo\",\n      \"type\": \"string\",\n      \"fieldType\": \"text\",\n      \"groupName\": \"companyinformation\"\n    },\n    {\n      \"name\": \"type\",\n      \"label\": \"Sona: Type\",\n      \"type\": \"string\",\n      \"fieldType\": \"text\",\n      \"groupName\": \"companyinformation\"\n    },\n    {\n      \"name\": \"employees_range\",\n      \"label\": \"Sona: Employees Range\",\n      \"type\": \"string\",\n      \"fieldType\": \"text\",\n      \"groupName\": \"companyinformation\"\n    },\n    {\n      \"name\": \"estimated_annual_revenue\",\n      \"label\": \"Sona: Estimated Annual Revenue\",\n      \"type\": \"string\",\n      \"fieldType\": \"text\",\n      \"groupName\": \"companyinformation\"\n    },\n    {\n      \"name\": \"tags\",\n      \"label\": \"Sona: Tags\",\n      \"type\": \"string\",\n      \"fieldType\": \"textarea\",\n      \"groupName\": \"companyinformation\"\n    },\n    {\n      \"name\": \"ips\",\n      \"label\": \"Sona: IPs\",\n      \"type\": \"string\",\n      \"fieldType\": \"textarea\",\n      \"groupName\": \"companyinformation\"\n    },\n    {\n      \"name\": \"category\",\n      \"label\": \"Sona: Category\",\n      \"type\": \"string\",\n      \"fieldType\": \"text\",\n      \"groupName\": \"companyinformation\"\n    },\n    {\n      \"name\": \"sub_category\",\n      \"label\": \"Sona: Sub Category\",\n      \"type\": \"string\",\n      \"fieldType\": \"text\",\n      \"groupName\": \"companyinformation\"\n    },\n    {\n      \"name\": \"tagline\",\n      \"label\": \"Sona: Tagline\",\n      \"type\": \"string\",\n      \"fieldType\": \"text\",\n      \"groupName\": \"companyinformation\"\n    },\n    {\n      \"name\": \"specialties\",\n      \"label\": \"Sona: Specialties\",\n      \"type\": \"string\",\n      \"fieldType\": \"textarea\",\n      \"groupName\": \"companyinformation\"\n    },\n    {\n      \"name\": \"ads_30days\",\n      \"label\": \"Sona: Ads 30 Days\",\n      \"type\": \"string\",\n      \"fieldType\": \"text\",\n      \"groupName\": \"companyinformation\"\n    },\n    {\n      \"name\": \"ads_365days\",\n      \"label\": \"Sona: Ads 365 Days\",\n      \"type\": \"string\",\n      \"fieldType\": \"text\",\n      \"groupName\": \"companyinformation\"\n    },\n    {\n      \"name\": \"ads_ytd\",\n      \"label\": \"Sona: Ads YTD\",\n      \"type\": \"string\",\n      \"fieldType\": \"text\",\n      \"groupName\": \"companyinformation\"\n    },\n    {\n      \"name\": \"social_handles\",\n      \"label\": \"Sona: Social Handles\",\n      \"type\": \"string\",\n      \"fieldType\": \"textarea\",\n      \"groupName\": \"companyinformation\"\n    },\n    {\n      \"name\": \"linkedin_url\",\n      \"label\": \"Sona: LinkedIn URL\",\n      \"type\": \"string\",\n      \"fieldType\": \"text\",\n      \"groupName\": \"companyinformation\"\n    },\n    {\n      \"name\": \"facebook_url\",\n      \"label\": \"Sona: Facebook URL\",\n      \"type\": \"string\",\n      \"fieldType\": \"text\",\n      \"groupName\": \"companyinformation\"\n    },\n    {\n      \"name\": \"instagram_url\",\n      \"label\": \"Sona: Instagram URL\",\n      \"type\": \"string\",\n      \"fieldType\": \"text\",\n      \"groupName\": \"companyinformation\"\n    },\n    {\n      \"name\": \"youtube_url\",\n      \"label\": \"Sona: YouTube URL\",\n      \"type\": \"string\",\n      \"fieldType\": \"text\",\n      \"groupName\": \"companyinformation\"\n    },\n    {\n      \"name\": \"tiktok_url\",\n      \"label\": \"Sona: TikTok URL\",\n      \"type\": \"string\",\n      \"fieldType\": \"text\",\n      \"groupName\": \"companyinformation\"\n    },\n    {\n      \"name\": \"pinterest_url\",\n      \"label\": \"Sona: Pinterest URL\",\n      \"type\": \"string\",\n      \"fieldType\": \"text\",\n      \"groupName\": \"companyinformation\"\n    },\n    {\n      \"name\": \"github_url\",\n      \"label\": \"Sona: GitHub URL\",\n      \"type\": \"string\",\n      \"fieldType\": \"text\",\n      \"groupName\": \"companyinformation\"\n    },\n    {\n      \"name\": \"discord_url\",\n      \"label\": \"Sona: Discord URL\",\n      \"type\": \"string\",\n      \"fieldType\": \"text\",\n      \"groupName\": \"companyinformation\"\n    },\n    {\n      \"name\": \"telegram_url\",\n      \"label\": \"Sona: Telegram URL\",\n      \"type\": \"string\",\n      \"fieldType\": \"text\",\n      \"groupName\": \"companyinformation\"\n    },\n    {\n      \"name\": \"reddit_url\",\n      \"label\": \"Sona: Reddit URL\",\n      \"type\": \"string\",\n      \"fieldType\": \"text\",\n      \"groupName\": \"companyinformation\"\n    },\n    {\n      \"name\": \"snapchat_url\",\n      \"label\": \"Sona: Snapchat URL\",\n      \"type\": \"string\",\n      \"fieldType\": \"text\",\n      \"groupName\": \"companyinformation\"\n    },\n    {\n      \"name\": \"medium_url\",\n      \"label\": \"Sona: Medium URL\",\n      \"type\": \"string\",\n      \"fieldType\": \"text\",\n      \"groupName\": \"companyinformation\"\n    },\n    {\n      \"name\": \"twitch_url\",\n      \"label\": \"Sona: Twitch URL\",\n      \"type\": \"string\",\n      \"fieldType\": \"text\",\n      \"groupName\": \"companyinformation\"\n    },\n    {\n      \"name\": \"crunchbase_url\",\n      \"label\": \"Sona: Crunchbase URL\",\n      \"type\": \"string\",\n      \"fieldType\": \"text\",\n      \"groupName\": \"companyinformation\"\n    },\n    {\n      \"name\": \"g2_url\",\n      \"label\": \"Sona: G2 URL\",\n      \"type\": \"string\",\n      \"fieldType\": \"text\",\n      \"groupName\": \"companyinformation\"\n    },\n    {\n      \"name\": \"founder_identifiers\",\n      \"label\": \"Sona: Founder Identifiers\",\n      \"type\": \"string\",\n      \"fieldType\": \"textarea\",\n      \"groupName\": \"companyinformation\"\n    },\n    {\n      \"name\": \"num_founders\",\n      \"label\": \"Sona: Number of Founders\",\n      \"type\": \"string\",\n      \"fieldType\": \"text\",\n      \"groupName\": \"companyinformation\"\n    },\n    {\n      \"name\": \"organic_keywords\",\n      \"label\": \"Sona: Organic Keywords\",\n      \"type\": \"string\",\n      \"fieldType\": \"text\",\n      \"groupName\": \"companyinformation\"\n    },\n    {\n      \"name\": \"organic_traffic\",\n      \"label\": \"Sona: Organic Traffic\",\n      \"type\": \"string\",\n      \"fieldType\": \"text\",\n      \"groupName\": \"companyinformation\"\n    },\n    {\n      \"name\": \"organic_cost\",\n      \"label\": \"Sona: Organic Cost\",\n      \"type\": \"string\",\n      \"fieldType\": \"text\",\n      \"groupName\": \"companyinformation\"\n    },\n    {\n      \"name\": \"adwords_keywords\",\n      \"label\": \"Sona: AdWords Keywords\",\n      \"type\": \"string\",\n      \"fieldType\": \"text\",\n      \"groupName\": \"companyinformation\"\n    },\n    {\n      \"name\": \"adwords_traffic\",\n      \"label\": \"Sona: AdWords Traffic\",\n      \"type\": \"string\",\n      \"fieldType\": \"text\",\n      \"groupName\": \"companyinformation\"\n    },\n    {\n      \"name\": \"adwords_cost\",\n      \"label\": \"Sona: AdWords Cost\",\n      \"type\": \"string\",\n      \"fieldType\": \"text\",\n      \"groupName\": \"companyinformation\"\n    },\n    {\n      \"name\": \"github_has_organization_projects\",\n      \"label\": \"Sona: GitHub Has Organization Projects\",\n      \"type\": \"string\",\n      \"fieldType\": \"text\",\n      \"groupName\": \"companyinformation\"\n    },\n    {\n      \"name\": \"github_has_repository_projects\",\n      \"label\": \"Sona: GitHub Has Repository Projects\",\n      \"type\": \"string\",\n      \"fieldType\": \"text\",\n      \"groupName\": \"companyinformation\"\n    },\n    {\n      \"name\": \"github_public_repos\",\n      \"label\": \"Sona: GitHub Public Repos\",\n      \"type\": \"string\",\n      \"fieldType\": \"text\",\n      \"groupName\": \"companyinformation\"\n    },\n    {\n      \"name\": \"github_public_gists\",\n      \"label\": \"Sona: GitHub Public Gists\",\n      \"type\": \"string\",\n      \"fieldType\": \"text\",\n      \"groupName\": \"companyinformation\"\n    },\n    {\n      \"name\": \"github_followers\",\n      \"label\": \"Sona: GitHub Followers\",\n      \"type\": \"string\",\n      \"fieldType\": \"text\",\n      \"groupName\": \"companyinformation\"\n    },\n    {\n      \"name\": \"github_following\",\n      \"label\": \"Sona: GitHub Following\",\n      \"type\": \"string\",\n      \"fieldType\": \"text\",\n      \"groupName\": \"companyinformation\"\n    },\n    {\n      \"name\": \"github_is_verified\",\n      \"label\": \"Sona: GitHub Is Verified\",\n      \"type\": \"string\",\n      \"fieldType\": \"text\",\n      \"groupName\": \"companyinformation\"\n    },\n    {\n      \"name\": \"linkedin_id\",\n      \"label\": \"Sona: LinkedIn ID\",\n      \"type\": \"string\",\n      \"fieldType\": \"text\",\n      \"groupName\": \"companyinformation\"\n    }\n  ]\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "hubspotAppToken"
      },
      "credentials": {
        "hubspotAppToken": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "d7de0fcb-152e-4c98-8f95-06fcf47ccfa7",
      "name": "Prepare Data for Loop",
      "type": "n8n-nodes-base.set",
      "position": [
        -528,
        640
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "96150e0f-f64e-4fac-88e2-ad783b76f48e",
              "name": "domains",
              "type": "array",
              "value": "={{ $('Aggregate').first().json['Website Domain'] }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "416d66cf-fbbb-4f12-a31c-d42add3c7b13",
      "name": "Split Companies and AI Output into Items",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        -304,
        640
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "domains"
      },
      "typeVersion": 1
    },
    {
      "id": "b47353dd-9594-45ec-a192-e5eae43b550b",
      "name": "End",
      "type": "n8n-nodes-base.noOp",
      "position": [
        256,
        672
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "c2cfba98-f310-4f13-8849-2a128f895f50",
      "name": "Loop Through Companies",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        16,
        688
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "85017b94-98ac-4ad5-96a3-1d18012b6c37",
      "name": "Format Custom Properties",
      "type": "n8n-nodes-base.code",
      "position": [
        256,
        1024
      ],
      "parameters": {
        "jsCode": "const data = $('Sona Enrich').item.json.data;\n\n// Format social handles nicely\nlet formattedSocialHandles = '';\nif (data.socialHandles) {\n  try {\n    const socialHandlesObj = typeof data.socialHandles === 'string' \n      ? JSON.parse(data.socialHandles) \n      : data.socialHandles;\n    \n    formattedSocialHandles = Object.entries(socialHandlesObj)\n      .filter(([key, value]) => value) // Only include non-empty values\n      .map(([key, value]) => `${key.charAt(0).toUpperCase() + key.slice(1)}: ${value}`)\n      .join('\\n');\n  } catch (e) {\n    formattedSocialHandles = data.socialHandles;\n  }\n}\n\nreturn [{\n  json: {\n    properties: {\n      tech: Array.isArray(data.tech) ? data.tech.join(', ') : data.tech,\n      tech_categories: Array.isArray(data.techCategories) ? data.techCategories.join(', ') : data.techCategories,\n      min_estimated_annual_revenue: data.minEstimatedAnnualRevenue,\n      max_estimated_annual_revenue: data.maxEstimatedAnnualRevenue,\n      sub_industry: data.subIndustry,\n      lat: data.lat,\n      lng: data.lng,\n      logo: data.logo,\n      employees_range: data.employeesRange,\n      estimated_annual_revenue: data.estimatedAnnualRevenue,\n      tags: Array.isArray(data.tags) ? data.tags.join(', ') : data.tags,\n      ips: Array.isArray(data.ips) ? data.ips.join(', ') : data.ips,\n      category: data.category,\n      sub_category: data.subCategory,\n      tagline: data.tagline,\n      specialties: Array.isArray(data.specialties) ? data.specialties.join(', ') : data.specialties,\n      ads_30days: data.ads30days,\n      ads_365days: data.ads365days,\n      ads_ytd: data.adsYTD,\n      social_handles: formattedSocialHandles,\n      linkedin_url: data.linkedinUrl,\n      facebook_url: data.facebookUrl,\n      instagram_url: data.instagramUrl,\n      youtube_url: data.youtubeUrl,\n      tiktok_url: data.tiktokUrl,\n      pinterest_url: data.pinterestUrl,\n      github_url: data.githubUrl,\n      discord_url: data.discordUrl,\n      telegram_url: data.telegramUrl,\n      reddit_url: data.redditUrl,\n      snapchat_url: data.snapchatUrl,\n      medium_url: data.mediumUrl,\n      twitch_url: data.twitchUrl,\n      crunchbase_url: data.crunchbaseUrl,\n      g2_url: data.g2Url,\n      founder_identifiers: Array.isArray(data.founderIdentifiers) ? data.founderIdentifiers.join(', ') : data.founderIdentifiers,\n      num_founders: data.numFounders,\n      organic_keywords: data.organicKeywords,\n      organic_traffic: data.organicTraffic,\n      organic_cost: data.organicCost,\n      adwords_keywords: data.adwordsKeywords,\n      adwords_traffic: data.adwordsTraffic,\n      adwords_cost: data.adwordsCost,\n      github_has_organization_projects: data.githubHasOrganizationProjects,\n      github_has_repository_projects: data.githubHasRepositoryProjects,\n      github_public_repos: data.githubPublicRepos,\n      github_public_gists: data.githubPublicGists,\n      github_followers: data.githubFollowers,\n      github_following: data.githubFollowing,\n      github_is_verified: data.githubIsVerified,\n      linkedin_id: data.linkedinId\n    }\n  }\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "04db3a1f-5d45-4e63-9a8b-127d840c80c0",
      "name": "Update Company with AI Data",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        64,
        1248
      ],
      "parameters": {
        "url": "=https://api.hubapi.com/crm/v3/objects/companies/{{ $('Create HubSpot Company').first().json.companyId }}",
        "method": "PATCH",
        "options": {},
        "jsonBody": "={{ $json }}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "nodeCredentialType": "hubspotAppToken"
      },
      "credentials": {
        "hubspotAppToken": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "9a555a02-3b9e-44f3-8614-e0c00a074c81",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        -208,
        224
      ],
      "parameters": {
        "options": {},
        "fieldsToAggregate": {
          "fieldToAggregate": [
            {
              "fieldToAggregate": "Website Domain"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "0e167f30-9400-4eb1-b2e1-2b6384a0c61e",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -64,
        432
      ],
      "parameters": {
        "color": 2,
        "width": 496,
        "height": 1024,
        "content": "## \ud83d\udd0d Step 4: Enrich & Sync to HubSpot\n\n**What happens here:**\n- Loops through each company domain\n- Calls Sona API for enrichment data\n- Creates company in HubSpot with standard fields\n- Formats and updates custom Sona properties\n- Combines firmographics + tech data in one profile"
      },
      "typeVersion": 1
    },
    {
      "id": "ab47d484-f381-41a1-9d14-5239e9711278",
      "name": "Wait 2 seconds",
      "type": "n8n-nodes-base.wait",
      "position": [
        272,
        1248
      ],
      "parameters": {
        "amount": 2
      },
      "typeVersion": 1.1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "f9d9f994-b02e-4711-836b-282c352bd657",
  "connections": {
    "Start": {
      "main": [
        [
          {
            "node": "Get Company List from Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate": {
      "main": [
        [
          {
            "node": "Create Custom HubSpot Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sona Enrich": {
      "main": [
        [
          {
            "node": "Create HubSpot Company",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait 2 seconds": {
      "main": [
        [
          {
            "node": "Loop Through Companies",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Data for Loop": {
      "main": [
        [
          {
            "node": "Split Companies and AI Output into Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create HubSpot Company": {
      "main": [
        [
          {
            "node": "Format Custom Properties",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Through Companies": {
      "main": [
        [
          {
            "node": "End",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Sona Enrich",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Custom Properties": {
      "main": [
        [
          {
            "node": "Update Company with AI Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Company List from Sheet": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Company with AI Data": {
      "main": [
        [
          {
            "node": "Wait 2 seconds",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Custom HubSpot Fields": {
      "main": [
        [
          {
            "node": "Prepare Data for Loop",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Companies and AI Output into Items": {
      "main": [
        [
          {
            "node": "Loop Through Companies",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}