{
  "name": "AI-driven lead classification & routing with HighLevel and Azure GPT-4o-mini",
  "nodes": [
    {
      "id": "14abd76c-5099-45d6-9ff3-f95af9f47056",
      "name": "When clicking ‘Execute workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -2640,
        736
      ]
    },
    {
      "id": "73d64595-b0ba-4a49-b03e-aeeff73b40be",
      "name": "Sticky Note - Workflow Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3072,
        592
      ],
      "parameters": {
        "width": 360,
        "height": 352,
        "content": "## 🤖 AI-POWERED LEAD ROUTING WORKFLOW\n\nThis workflow uses AI to intelligently categorize and route leads:\n\n1. Fetches opportunities from HighLevel\n2. Gets contact details for each opportunity\n3. AI an"
      }
    },
    {
      "id": "ff1ad33d-0c3d-465d-a509-ca49f0b2a5d5",
      "name": "Sticky Note - Data Collection",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2416,
        384
      ],
      "parameters": {
        "width": 320,
        "height": 304,
        "content": "## 📥 DATA COLLECTION PHASE\n\n**Step 1:** Fetch all opportunities from HighLevel CRM\n**Step 2:** Get detailed contact information for each opportunity\n\nThis provides complete lead data (name, email, not"
      }
    },
    {
      "id": "dfa52319-320d-475b-9262-b8f624f53013",
      "name": "Sticky Note - AI Analysis",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2080,
        1072
      ],
      "parameters": {
        "width": 340,
        "height": 280,
        "content": "## 🧠 AI ANALYSIS PHASE\n\n**AI Agent:** Analyzes lead message/notes to determine intent\n\n**Azure OpenAI Model:** GPT-4o-mini processes contact data and classifies leads\n\n**Prompt:** \"You are an AI lead "
      }
    },
    {
      "id": "52a4bef2-ff2f-4c34-ac9e-aea35f8c6f89",
      "name": "Sticky Note - Routing Logic",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -816,
        624
      ],
      "parameters": {
        "width": 360,
        "height": 352,
        "content": "## 🔀 INTELLIGENT ROUTING\n\nBased on AI classification, leads are routed to:\n\n**🎯 Demo Requests** → demo@company.com\n**🛠️ Support Queries** → support@company.com\n**🤝 Partnership Inquiries** → partnershi"
      }
    },
    {
      "id": "ce2aa645-d4a4-401b-afd2-2de399a3590a",
      "name": "Sticky Note - Processing",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1776,
        368
      ],
      "parameters": {
        "width": 280,
        "height": 316,
        "content": "## ⚙️ POST-PROCESSING\n\nJavaScript code node that processes AI output and prepares data for routing conditions.\n\n**Purpose:** Transforms AI response into usable format for conditional branching.\n\n**Not"
      }
    },
    {
      "id": "2b1578f2-7e7f-4874-8481-7e615ade490a",
      "name": "Check: Demo Request?",
      "type": "n8n-nodes-base.if",
      "position": [
        -1392,
        656
      ]
    },
    {
      "id": "d2b3fe52-4857-4031-9ef1-e689678b3ef8",
      "name": "Route to Demo Team",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        -1088,
        544
      ]
    },
    {
      "id": "9d878a92-9ffe-4c9b-aea5-9d54c750ae0e",
      "name": "Check: Support Query?",
      "type": "n8n-nodes-base.if",
      "position": [
        -1392,
        848
      ]
    },
    {
      "id": "1e6fabeb-1f5d-4715-b579-483b99249102",
      "name": "Route to Support Team",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        -1088,
        800
      ]
    },
    {
      "id": "649aa2c1-f3e0-4da9-8a4a-9077273a55f8",
      "name": "Check: Partnership Inquiry?",
      "type": "n8n-nodes-base.if",
      "position": [
        -1392,
        1056
      ]
    },
    {
      "id": "dc06d9fa-a7c1-4cc2-9161-231ac977e44f",
      "name": "Route to Partnership Team",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        -1088,
        1008
      ]
    },
    {
      "id": "050df426-cc6c-42d4-9d98-7af4752f1e97",
      "name": "AI Lead Classifier Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -1984,
        736
      ]
    },
    {
      "id": "dbc6739b-dd49-481a-9b77-d7303229142f",
      "name": "Fetch All Opportunities",
      "type": "n8n-nodes-base.highLevel",
      "position": [
        -2400,
        736
      ]
    },
    {
      "id": "bd6b5b4f-a0aa-42c9-8f00-ea15de067a70",
      "name": "Azure OpenAI GPT-4o-mini",
      "type": "@n8n/n8n-nodes-langchain.lmChatAzureOpenAi",
      "position": [
        -2016,
        928
      ]
    },
    {
      "id": "91516bae-94ac-4647-8985-4eca9526d15e",
      "name": "Process AI Response",
      "type": "n8n-nodes-base.code",
      "position": [
        -1632,
        736
      ]
    },
    {
      "id": "fe176854-c40c-4925-abef-2826261ff25b",
      "name": "Fetch Contact Details",
      "type": "n8n-nodes-base.highLevel",
      "position": [
        -2192,
        736
      ]
    }
  ],
  "connections": {
    "Process AI Response": {
      "main": [
        [
          {
            "node": "Check: Demo Request?",
            "type": "main",
            "index": 0
          },
          {
            "node": "Check: Support Query?",
            "type": "main",
            "index": 0
          },
          {
            "node": "Check: Partnership Inquiry?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check: Demo Request?": {
      "main": [
        [
          {
            "node": "Route to Demo Team",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check: Support Query?": {
      "main": [
        [
          {
            "node": "Route to Support Team",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Contact Details": {
      "main": [
        [
          {
            "node": "AI Lead Classifier Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch All Opportunities": {
      "main": [
        [
          {
            "node": "Fetch Contact Details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Lead Classifier Agent": {
      "main": [
        [
          {
            "node": "Process AI Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Azure OpenAI GPT-4o-mini": {
      "ai_languageModel": [
        [
          {
            "node": "AI Lead Classifier Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Check: Partnership Inquiry?": {
      "main": [
        [
          {
            "node": "Route to Partnership Team",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Fetch All Opportunities",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}