{
  "nodes": [
    {
      "id": "fcd79d28-692a-41d3-9a92-78567ce148ae",
      "name": "Run daily",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        512,
        160
      ],
      "parameters": {
        "rule": {
          "interval": [
            {}
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "830fac2b-14a4-4249-aa96-901ae8119a6a",
      "name": "Get recently created/updated contacts",
      "type": "n8n-nodes-base.hubspot",
      "position": [
        720,
        160
      ],
      "parameters": {
        "limit": 1,
        "operation": "getRecentlyCreatedUpdated",
        "authentication": "oAuth2",
        "additionalFields": {}
      },
      "credentials": {
        "hubspotOAuth2Api": {
          "id": "credential-id",
          "name": "hubspotOAuth2Api Credential"
        }
      },
      "notesInFlow": true,
      "typeVersion": 2.1
    },
    {
      "id": "896d9486-d0b9-4e2e-afc2-128fed120d6c",
      "name": "Filter contacts created in the last 24h",
      "type": "n8n-nodes-base.filter",
      "position": [
        960,
        160
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "3f05e8cd-81e1-4495-a5fc-b7e8cadcef75",
              "operator": {
                "type": "dateTime",
                "operation": "afterOrEquals"
              },
              "leftValue": "={{ $json.properties.createdate.value.toDateTime('ms') }}",
              "rightValue": "={{ $today.minus(1, 'days') }}"
            },
            {
              "id": "5dc4e198-582a-45e5-9216-ebcbcd455a3e",
              "operator": {
                "type": "string",
                "operation": "notContains"
              },
              "leftValue": "={{ $json['identity-profiles'][0].identities[0].value }}",
              "rightValue": "gmail.com"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "1b2b6dd7-266f-4461-91dd-73cdaedae561",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        1248,
        384
      ],
      "parameters": {
        "options": {},
        "credentials": {
          "googlePalmApi": {
            "id": "credential-id",
            "name": "googlePalmApi Credential"
          }
        }
      },
      "typeVersion": 1
    },
    {
      "id": "7a6bcf9c-e7c6-4712-9cb3-a8292c723389",
      "name": "Company Research Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1248,
        160
      ],
      "parameters": {
        "text": "=You’re an analyst specializing in company profiling. You’ll receive a domain and must return structured data only.\n\nDomain to research (extract it from the email and then search the web from the SerpAPI tool): {{ $json['identity-profiles'][0].identities[0].value }}\n\nReturn only a JSON object with exactly these fields (keep the keys as written):\n\ncompany_name: Full legal or commonly used company name\n\nindustry: Primary industry category\n\nheadquarters_city: City\n\nheadquarters_country: Country\n\nemployee_count: Approximate employee count (number or range)\n\nwebsite: Official site URL\n\nlinkedin: Company LinkedIn URL (if available)\n\ndescription: One or two sentences summarizing what the company does\n\nUse reliable, verifiable sources. No commentary—output JSON only.",
        "options": {},
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 2
    },
    {
      "id": "43048b3a-174b-458e-b616-424195444066",
      "name": "Search the web with SerpAPI",
      "type": "@n8n/n8n-nodes-langchain.toolSerpApi",
      "position": [
        1440,
        384
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "serpApi": {
          "id": "credential-id",
          "name": "serpApi Credential"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "8f899dcc-54da-469e-a842-36028bb02dac",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1616,
        384
      ],
      "parameters": {
        "jsonSchemaExample": "{\n\"company_name\": \"n8n\",\n\"industry\": \"Software Development\",\n\"headquarters_city\": \"Berlin\",\n\"headquarters_country\": \"Germany\",\n\"employee_count\": \"51-200\",\n\"website\": \"https://n8n.io\",\n\"linkedin\": \"https://www.linkedin.com/company/n8n-io\",\n\"description\": \"n8n is a workflow automation tool that integrates AI capabilities with business process automation, enabling users to automate tasks and synchronize data across various applications and services.\"\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "7ab9fabc-0ee0-4bba-a368-81015942b07b",
      "name": "Add company info",
      "type": "n8n-nodes-base.hubspot",
      "position": [
        1904,
        160
      ],
      "parameters": {
        "email": "={{ $('Get recently created/updated contacts').item.json['identity-profiles'][0].identities[0].value }}",
        "options": {},
        "authentication": "oAuth2",
        "additionalFields": {
          "city": "={{ $json.output.headquarters_city }}",
          "country": "={{ $json.output.headquarters_country }}",
          "websiteUrl": "={{ $json.output.website }}",
          "companyName": "={{ $json.output.company_name }}",
          "companySize": "={{ $json.output.employee_count }}",
          "linkedinUrl": "={{ $json.output.linkedin }}"
        }
      },
      "credentials": {
        "hubspotOAuth2Api": {
          "id": "credential-id",
          "name": "hubspotOAuth2Api Credential"
        }
      },
      "typeVersion": 2.1
    }
  ],
  "connections": {
    "Run daily": {
      "main": [
        [
          {
            "node": "Get recently created/updated contacts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get recently created/updated contacts": {
      "main": [
        [
          {
            "node": "Filter contacts created in the last 24h",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter contacts created in the last 24h": {
      "main": [
        [
          {
            "node": "Company Research Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Company Research Agent": {
      "main": [
        [
          {
            "node": "Search the web with SerpAPI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search the web with SerpAPI": {
      "main": [
        [
          {
            "node": "Google Gemini Chat Model",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "main": [
        [
          {
            "node": "Structured Output Parser",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "main": [
        [
          {
            "node": "Add company info",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}