{
  "nodes": [
    {
      "id": "8ab901f4-f5ba-4e49-98ee-8ad2f4c2c95b",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        416,
        432
      ],
      "parameters": {
        "color": 7,
        "width": 224,
        "height": 480,
        "content": "Typeform trigger:  Gets trigger after capturing lead data"
      },
      "typeVersion": 1
    },
    {
      "id": "923b782c-b7c2-4f37-bed4-e5c7f8c71b91",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1552,
        432
      ],
      "parameters": {
        "color": 7,
        "width": 192,
        "height": 480,
        "content": "Create or Update contact in hubspot"
      },
      "typeVersion": 1
    },
    {
      "id": "d186deee-808b-42f8-824e-e4ce11401c02",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -544,
        432
      ],
      "parameters": {
        "width": 928,
        "height": 1056,
        "content": "## AI-Enhanced Lead Qualification & HubSpot Synchronization (Jotform to HubSpot) \ud83e\udde0\u2728\n\nStop wasting time on bad leads and manual research. This advanced **n8n workflow** automates your entire lead qualification and CRM entry process for HubSpot, ensuring you only sync **high-quality, pre-researched contacts**.\n\nWhen a prospect submits your form, this automation immediately:\n\n1.  **Verifies the lead's email** using Verifalia to ensure deliverability.\n2.  **Performs an AI-powered website crawl** to extract and structure key competitive information like the prospect's **Company Name**, **Industry**, **Country**, and a **Website Summary**.\n3.  **Uses Google Gemini to create an instant, personalized summary** of the lead's potential, acting as your *virtual sales assistant*.\n4.  Finally, it creates or updates the comprehensive, enhanced contact record in **HubSpot CRM** and sends a smart **Gmail notification** to your sales team with the AI summary for immediate, informed follow-up.\n\n***\n\n## How it Works\n\nThis automation turns raw form submissions into fully enriched, sales-ready contacts in HubSpot:\n\n1.  **Lead Capture (Jotform):** A prospect fills out your Jotform with their details, triggering the workflow instantly.\n2.  **Email Verification (Verifalia):** The email address is sent to the Verifalia API. **Only verified, deliverable emails are allowed to proceed**, eliminating bad data from your HubSpot portal.\n3.  **Website Crawl & Data Extraction (HTTP Request & AI):** The workflow accesses the prospect's website and uses an **Information Extractor** (powered by an underlying Language Model like Google Gemini or similar AI) to automatically pull essential business data like **Industry** and **Company Name**.\n4.  **AI Lead Scoring & Summarization (Google Gemini):** All captured and enriched data is fed to the Google Gemini model. The AI acts as a smart assistant, analyzing the lead's profile to generate a **short, prospective summary** for your sales team.\n5.  **HubSpot Synchronization:** The final, enriched contact data (including all AI-extracted fields) is used to either **create a new contact** or **update an existing one** in your **HubSpot CRM**.\n6.  **Intelligent Internal Notification (Gmail):** Your sales team receives an immediate internal email. This alert contains the raw lead data **plus the critical AI-generated summary**, allowing them to prioritize and personalize their follow-up immediately.\n\n***\n\n## Requirements\n\nTo set up this intelligent lead funnel, you'll need the following accounts and credentials configured in your n8n instance:\n\n* **Jotform Credentials:** An **API Key** for the **JotForm Trigger**.\n* **Verifalia Credentials:** An **API Key** for the **Lead Verification** node.\n* **AI/Language Model Credentials:** Credentials for the **Information Extractor** and **Message a model** (e.g., Google Gemini/PaLM API Key) to perform website research and summarization.\n* **HubSpot Credentials:** An **OAuth2** or **API Key** credential for the **HubSpot** node to manage contacts.\n* **Gmail Credentials:** An **OAuth2** credential for the **Gmail** node to send internal notifications.\n* **Jotform:** An active form containing the necessary fields: **First Name**, **Last Name**, **Email**, **Phone**, **Website**, and **Note**."
      },
      "typeVersion": 1
    },
    {
      "id": "49288ea6-6928-4cc6-a3c0-7c707e084c5b",
      "name": "Create or update a contact",
      "type": "n8n-nodes-base.hubspot",
      "position": [
        1600,
        624
      ],
      "parameters": {
        "email": "={{ $('JotForm Trigger').item.json.email }}",
        "options": {},
        "additionalFields": {
          "country": "={{ $json.country }}",
          "message": "={{ $('JotForm Trigger').item.json.note }}",
          "industry": "={{ $json.industry }}",
          "lastName": "={{ $('JotForm Trigger').item.json.lastname }}",
          "firstName": "={{ $('JotForm Trigger').item.json.firstname }}",
          "websiteUrl": "={{ $('JotForm Trigger').item.json.website }}",
          "companyName": "={{ $json.company_name }}",
          "phoneNumber": "={{ $('JotForm Trigger').item.json.phone }}"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "7a7eb3d4-5ff0-4ffe-84dd-b6685e464867",
      "name": "JotForm Trigger",
      "type": "n8n-nodes-base.jotFormTrigger",
      "position": [
        480,
        624
      ],
      "parameters": {
        "form": "252856264643060"
      },
      "typeVersion": 1
    },
    {
      "id": "4f2927a2-337c-4828-834c-79024866e84c",
      "name": "Send a message",
      "type": "n8n-nodes-base.gmail",
      "position": [
        2288,
        624
      ],
      "parameters": {
        "message": "={{ $json.content.parts[0].text }}\n\nHere are the details:\n\nName: {{ $('JotForm Trigger').item.json.firstname }} {{ $('JotForm Trigger').item.json.lastname }}\nEmail: {{ $('JotForm Trigger').item.json.email }}\nPhone: {{ $('JotForm Trigger').item.json.phone }}\nCountry: {{ $('Information Extractor').item.json.country ?? \"\" }}\nIndustry: {{ $('Information Extractor').item.json.industry }}\nCompany Name: {{ $('Information Extractor').item.json.company_name }}\nSummary: Country: {{ $('Information Extractor').item.json.summary }}\n\nWebsite: {{ $('JotForm Trigger').item.json.website }}\nNote: {{ $('JotForm Trigger').item.json.note }}",
        "options": {},
        "subject": "New Lead Captured",
        "emailType": "text"
      },
      "typeVersion": 2.1
    },
    {
      "id": "5b3576a0-b116-4c4f-90ec-4a442cd39fe5",
      "name": "Lead Verification",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        736,
        624
      ],
      "parameters": {
        "url": "https://api.verifalia.com/v2.7/email-validations",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"entries\": [\n    {\n      \"inputData\": {{$json.email}}\n    }\n  ]\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "Accept",
              "value": "application/json"
            },
            {
              "name": "authorization"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "7e731d3a-8ae3-421c-a729-385de4fd87d8",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        672,
        432
      ],
      "parameters": {
        "width": 224,
        "height": 480,
        "content": "Verify Leads on Email if they are not fake or temporary emails"
      },
      "typeVersion": 1
    },
    {
      "id": "fe98dd22-926a-402d-8211-a785edabd9fb",
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        960,
        624
      ],
      "parameters": {
        "url": "={{ $('JotForm Trigger').item.json.website }}",
        "options": {
          "allowUnauthorizedCerts": true
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "29100ecb-621e-4c00-987a-b4480d6cd012",
      "name": "Information Extractor",
      "type": "@n8n/n8n-nodes-langchain.informationExtractor",
      "position": [
        1168,
        624
      ],
      "parameters": {
        "text": "={{ $json.data }}",
        "options": {},
        "attributes": {
          "attributes": [
            {
              "name": "company_name",
              "required": true,
              "description": "Company name on the website or website name"
            },
            {
              "name": "country",
              "description": "country of the company"
            },
            {
              "name": "industry",
              "required": true,
              "description": "Industry like tech, marking, seo, e-commerce, finance etc"
            },
            {
              "name": "summary",
              "required": true,
              "description": "short summary about the website services"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "8af84dd9-8c79-4940-8154-c9e4d91bc055",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2240,
        432
      ],
      "parameters": {
        "color": 7,
        "width": 192,
        "height": 480,
        "content": "Send your self a notification"
      },
      "typeVersion": 1
    },
    {
      "id": "8cac2a21-3ead-4a4c-abb0-6133bb85cccb",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        1312,
        768
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "d2cb1f26-a068-48ed-ad02-abefbd789554",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        928,
        432
      ],
      "parameters": {
        "width": 592,
        "height": 480,
        "content": "Extract the website html and get country, industry, website summary and company name"
      },
      "typeVersion": 1
    },
    {
      "id": "a845b165-bdf3-4c0b-a45b-aa529a6ddef1",
      "name": "Message a model",
      "type": "@n8n/n8n-nodes-langchain.googleGemini",
      "position": [
        1856,
        624
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "models/gemini-2.5-flash",
          "cachedResultName": "models/gemini-2.5-flash"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "content": "=You are a writing assistant for email, which review the lead data and write a short summary to notify the me that if the lead is prospective.\n\nHere are the details:\n\nName: {{ $('JotForm Trigger').item.json.firstname }} {{ $('JotForm Trigger').item.json.lastname }}\nEmail: {{ $('JotForm Trigger').item.json.email }}\nPhone: {{ $('JotForm Trigger').item.json.phone }}\nCountry: {{ $('Information Extractor').item.json.country ?? \"\" }}\nIndustry: {{ $('Information Extractor').item.json.industry }}\nCompany Name: {{ $('Information Extractor').item.json.company_name }}\nSummary: Country: {{ $('Information Extractor').item.json.summary }}\n\nWebsite: {{ $('JotForm Trigger').item.json.website }}\nNote: {{ $('JotForm Trigger').item.json.note }}"
            }
          ]
        },
        "jsonOutput": true
      },
      "typeVersion": 1
    },
    {
      "id": "a28daaac-be36-44e3-8677-f9cbcb7d1039",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1776,
        432
      ],
      "parameters": {
        "color": 7,
        "width": 432,
        "height": 480,
        "content": "AI will summarize these data about the lead"
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "HTTP Request": {
      "main": [
        [
          {
            "node": "Information Extractor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "JotForm Trigger": {
      "main": [
        [
          {
            "node": "Lead Verification",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Message a model": {
      "main": [
        [
          {
            "node": "Send a message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Lead Verification": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Information Extractor": {
      "main": [
        [
          {
            "node": "Create or update a contact",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Information Extractor",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Create or update a contact": {
      "main": [
        [
          {
            "node": "Message a model",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}