{
  "name": "Auto-respond and classify WhatsApp leads with Ollama AI and log to Google Sheets",
  "nodes": [
    {
      "id": "59e9c93e-bcf1-4e6b-a773-b689bba5c0e0",
      "name": "🔧 Parse WhatsApp Message",
      "type": "n8n-nodes-base.code",
      "position": [
        0,
        752
      ]
    },
    {
      "id": "a68f112c-f642-4cae-b506-c333f8481f26",
      "name": "🤖 AI Intent Classifier",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        224,
        752
      ]
    },
    {
      "id": "e0d448a3-cb12-44a1-92d8-5cc102cdc4e0",
      "name": "🎯 Extract Classification",
      "type": "n8n-nodes-base.code",
      "position": [
        512,
        752
      ]
    },
    {
      "id": "29f47043-c208-41e5-b733-3c8d0c3d7e59",
      "name": "🔀 Route by Intent",
      "type": "n8n-nodes-base.switch",
      "position": [
        752,
        752
      ]
    },
    {
      "id": "cf872e56-6064-4480-a709-0b35f6b0aefe",
      "name": "💬 Hot Lead Reply",
      "type": "n8n-nodes-base.code",
      "position": [
        1024,
        240
      ]
    },
    {
      "id": "57dc303c-58fd-4843-8713-a0723d08f4ef",
      "name": "💬 Warm Lead Reply",
      "type": "n8n-nodes-base.code",
      "position": [
        1040,
        544
      ]
    },
    {
      "id": "92e58df8-3373-4903-af87-a0997a3b14fb",
      "name": "💬 Support Reply",
      "type": "n8n-nodes-base.code",
      "position": [
        1024,
        848
      ]
    },
    {
      "id": "663e1710-f9ae-44c5-8535-e673987ac3b5",
      "name": "🧠 Smart Qualification Reply",
      "type": "n8n-nodes-base.code",
      "position": [
        1040,
        1184
      ]
    },
    {
      "id": "4b26367d-1454-410b-a00f-ccc4cd617041",
      "name": "📊 Log Hot Lead",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1280,
        240
      ]
    },
    {
      "id": "1575f70e-2c71-4558-9f56-5b45ef1919c4",
      "name": "📊 Log Warm Lead",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1280,
        544
      ]
    },
    {
      "id": "2429189f-2536-4ffc-b8a0-445188b2ac7e",
      "name": "📊 Log Support",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1264,
        848
      ]
    },
    {
      "id": "73ef34e9-abd8-42af-bf67-9397e07ab590",
      "name": "📅 Book Meeting (Hot)",
      "type": "n8n-nodes-base.googleCalendar",
      "position": [
        1536,
        240
      ]
    },
    {
      "id": "d841bc4d-8899-4900-8d41-da02a603c192",
      "name": "📅 Book Meeting (Warm)",
      "type": "n8n-nodes-base.googleCalendar",
      "position": [
        1536,
        544
      ]
    },
    {
      "id": "df2d4acc-320b-427b-a5eb-ef212eeb8642",
      "name": "📱 Send Meeting (Hot)",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        1744,
        240
      ]
    },
    {
      "id": "3487d76d-3869-43fd-9d73-d53e624570c7",
      "name": "📱 Send Meeting (Warm)",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        1760,
        544
      ]
    },
    {
      "id": "0bf7972f-c4b6-4c7d-b16a-c8f50e2a2e0f",
      "name": "📱 Send Support Reply",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        1504,
        848
      ]
    },
    {
      "id": "781ca17f-0ece-4f8f-988a-a0d15eed09fa",
      "name": "📱 Send Qualifying Question",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        1312,
        1184
      ]
    },
    {
      "id": "9a25bf7e-7b7f-4ced-8bf6-0399b6ab19fa",
      "name": "WhatsApp Trigger",
      "type": "n8n-nodes-base.whatsAppTrigger",
      "position": [
        -224,
        752
      ]
    },
    {
      "id": "2bf8bb35-71d6-472e-93e0-d28447b61f00",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        352,
        976
      ]
    },
    {
      "id": "a40b2a98-3117-4bb3-9205-3b95e526a3e3",
      "name": "Ollama Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOllama",
      "position": [
        224,
        976
      ]
    },
    {
      "id": "486ef98e-c024-4fcf-a17a-676557641b8f",
      "name": "Sticky Note - Main Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1024,
        -96
      ],
      "parameters": {
        "width": 680,
        "height": 860,
        "content": "## Auto-respond and classify WhatsApp leads with AI and log to Google Sheets\n\nAutomatically classify incoming WhatsApp messages using AI, route them by intent, log every interaction to Google Sheets, "
      }
    },
    {
      "id": "80ba5bf8-26e0-4da4-bd64-361489771a2e",
      "name": "Sticky Note - Incoming",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -240,
        640
      ],
      "parameters": {
        "width": 384,
        "height": 212,
        "content": "## 📥 Incoming Message\nWhatsApp Trigger receives and parses incoming messages"
      }
    },
    {
      "id": "2b0afded-214d-480c-b853-ba23e604002c",
      "name": "Sticky Note - AI",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        192,
        640
      ],
      "parameters": {
        "width": 448,
        "height": 196,
        "content": "## 🤖 AI Classification + Extraction\nAI classifies intent, then robust parser extracts the result"
      }
    },
    {
      "id": "6f0aada9-17f8-4914-92b8-66eccf2a2071",
      "name": "Sticky Note - Router",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        688,
        624
      ],
      "parameters": {
        "width": 280,
        "height": 396,
        "content": "## 🔀 Intent Routing\nRoutes to the correct path based on AI classification"
      }
    },
    {
      "id": "98e417e7-eb5d-4165-81e9-3ab0427b3511",
      "name": "Sticky Note - Hot",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        992,
        144
      ],
      "parameters": {
        "width": 1024,
        "height": 240,
        "content": "## 🔥 Hot Lead Path\nReply → Log to Sheets → Book meeting → Send Google Meet invite"
      }
    },
    {
      "id": "eaf2a4ed-9999-428e-be10-617c3878162b",
      "name": "Sticky Note - Warm",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1008,
        464
      ],
      "parameters": {
        "width": 1008,
        "height": 240,
        "content": "## 🌡️ Warm Lead Path\nReply → Log to Sheets → Book meeting → Send Google Meet invite"
      }
    },
    {
      "id": "b9f1c25b-a26d-4f86-a389-244f81e2d6d6",
      "name": "Sticky Note - Support",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1008,
        752
      ],
      "parameters": {
        "width": 1024,
        "height": 256,
        "content": "## 🛠️ Support Path\nReply → Log to Sheets → Send ticket confirmation via WhatsApp"
      }
    },
    {
      "id": "a9454d6c-a33d-4cdc-ae12-c796f31e2a88",
      "name": "Sticky Note - Qualify",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1008,
        1088
      ],
      "parameters": {
        "width": 488,
        "height": 256,
        "content": "## ❓ Qualification Path\nSmart follow-up question via WhatsApp. Memory ensures re-classification on reply."
      }
    },
    {
      "id": "b7761232-2733-4579-aaff-ffd1a0c0f139",
      "name": "Sticky Note - Warning",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -496,
        992
      ],
      "parameters": {
        "width": 376,
        "height": null,
        "content": "## ⚠️ Update Bot Number\nChange the `BOT_NUMBERS` array in the Parse node to match your WhatsApp Business phone number ID. This prevents infinite loops from the bot replying to itself."
      }
    }
  ],
  "connections": {
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "🤖 AI Intent Classifier",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "WhatsApp Trigger": {
      "main": [
        [
          {
            "node": "🔧 Parse WhatsApp Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "📊 Log Support": {
      "main": [
        [
          {
            "node": "📱 Send Support Reply",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Ollama Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "🤖 AI Intent Classifier",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "📊 Log Hot Lead": {
      "main": [
        [
          {
            "node": "📅 Book Meeting (Hot)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "💬 Support Reply": {
      "main": [
        [
          {
            "node": "📊 Log Support",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "📊 Log Warm Lead": {
      "main": [
        [
          {
            "node": "📅 Book Meeting (Warm)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "💬 Hot Lead Reply": {
      "main": [
        [
          {
            "node": "📊 Log Hot Lead",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "💬 Warm Lead Reply": {
      "main": [
        [
          {
            "node": "📊 Log Warm Lead",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "🔀 Route by Intent": {
      "main": [
        [
          {
            "node": "💬 Hot Lead Reply",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "💬 Warm Lead Reply",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "💬 Support Reply",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "🧠 Smart Qualification Reply",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "📅 Book Meeting (Hot)": {
      "main": [
        [
          {
            "node": "📱 Send Meeting (Hot)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "📅 Book Meeting (Warm)": {
      "main": [
        [
          {
            "node": "📱 Send Meeting (Warm)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "🤖 AI Intent Classifier": {
      "main": [
        [
          {
            "node": "🎯 Extract Classification",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "🎯 Extract Classification": {
      "main": [
        [
          {
            "node": "🔀 Route by Intent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "🔧 Parse WhatsApp Message": {
      "main": [
        [
          {
            "node": "🤖 AI Intent Classifier",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "🧠 Smart Qualification Reply": {
      "main": [
        [
          {
            "node": "📱 Send Qualifying Question",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}