{
  "name": "Capture and score website leads with Gemini RAG, Supabase, Google Sheets and Slack alerts",
  "nodes": [
    {
      "id": "de3b285e-4006-421a-b580-f4e05c1e129c",
      "name": "Chat Trigger",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        -1712,
        256
      ]
    },
    {
      "id": "38e2375a-e033-4309-9694-bef4dd59628b",
      "name": "Vector Store",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
      "position": [
        -176,
        512
      ]
    },
    {
      "id": "3e75814d-af98-41c0-9f7e-7f8c6a9f70e6",
      "name": "Embeddings",
      "type": "@n8n/n8n-nodes-langchain.embeddingsGoogleGemini",
      "position": [
        -256,
        704
      ]
    },
    {
      "id": "a9eda68f-bb97-41bb-b9f5-117190c583ad",
      "name": "Reranker",
      "type": "@n8n/n8n-nodes-langchain.rerankerCohere",
      "position": [
        -96,
        704
      ]
    },
    {
      "id": "1e749878-5772-4b12-ab65-da65ddad4a53",
      "name": "Supabase Upsert - Save User Identity",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        -1200,
        512
      ]
    },
    {
      "id": "87e3c640-3f98-4efc-95c0-bb379bcc000e",
      "name": "Check Identity In DB",
      "type": "n8n-nodes-base.supabase",
      "position": [
        -1408,
        256
      ]
    },
    {
      "id": "f4ac6301-a6a1-488c-a984-0116f24f5493",
      "name": "Respond to Chat",
      "type": "@n8n/n8n-nodes-langchain.chat",
      "position": [
        -608,
        256
      ]
    },
    {
      "id": "schedule-trigger-scoring",
      "name": "Schedule Trigger - Score Leads",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -1680,
        1072
      ]
    },
    {
      "id": "if-has-leads",
      "name": "If Has Leads",
      "type": "n8n-nodes-base.if",
      "position": [
        -1008,
        1072
      ]
    },
    {
      "id": "filter-leads-to-score",
      "name": "Filter Leads Ready to Score",
      "type": "n8n-nodes-base.filter",
      "position": [
        -1232,
        1072
      ]
    },
    {
      "id": "d5680ad8-dec2-42d1-a995-6ac65bc076cb",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -800,
        1264
      ]
    },
    {
      "id": "fb8897d0-e7fd-43a6-bcb7-40900d792771",
      "name": "Google Gemini Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -1552,
        512
      ]
    },
    {
      "id": "af48ecde-f603-42b6-ac5c-d5538aa1f5d4",
      "name": "Postgres Chat Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryPostgresChat",
      "position": [
        -1376,
        512
      ]
    },
    {
      "id": "gs-get-leads-to-score",
      "name": "Get All Leads",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -1456,
        1072
      ]
    },
    {
      "id": "gs-mark-as-scored",
      "name": "Mark as Scored",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -384,
        1056
      ]
    },
    {
      "id": "c332f4d1-d44f-47bf-a028-3765533768ea",
      "name": "Update row in Google Sheets CRM",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        -672,
        512
      ]
    },
    {
      "id": "676d4a0b-d61d-4691-bf57-7777d1497398",
      "name": "Update row in Google Sheets CRM (2)",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        -608,
        1264
      ]
    },
    {
      "id": "check-lead-exists-crm",
      "name": "Check if Lead Exists in CRM",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        -1008,
        512
      ]
    },
    {
      "id": "6567e584-ff64-4523-8c7f-797dc9cab9d1",
      "name": "Append row in Google Sheets CRM",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        -848,
        512
      ]
    },
    {
      "id": "85c41b38-d5b2-4f26-aed9-833e3f8911b2",
      "name": "AI Support Specialist",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -1056,
        256
      ]
    },
    {
      "id": "01b65962-597c-4d22-b817-82657b15696c",
      "name": "AI Leader Scorer",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -752,
        1056
      ]
    },
    {
      "id": "e5a1ca3a-8d83-44f9-af34-254633f927fc",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1808,
        -240
      ],
      "parameters": {
        "width": 1408,
        "height": 336,
        "content": "## Sample Output\n\n### Google Sheets CRM updated \n**Creates a new row for a new lead, or updates an existing row for an existing lead. Enters details about the chat, and scores the lead.**\n[Link to Goo"
      }
    },
    {
      "id": "5da9a309-2b23-46cf-b7ce-c7a4cb2f194d",
      "name": "Slack Alert - New Lead and Intent",
      "type": "n8n-nodes-base.slackTool",
      "position": [
        -496,
        512
      ]
    },
    {
      "id": "ceab145b-1968-4990-a00e-1be96e3de4ef",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1808,
        128
      ],
      "parameters": {
        "width": 1968,
        "height": 756,
        "content": "## 1. AI Chat with Lead Capture\nLead messages trigger identity verification, RAG-powered responses, CRM updates, and Slack alerts for high-intent leads."
      }
    },
    {
      "id": "d3d922c3-ee9a-4de1-b122-97711de27767",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1808,
        912
      ],
      "parameters": {
        "width": 1968,
        "height": 592,
        "content": "## 2. AI-Powered Lead Qualification\nPeriodically scores leads based on conversation history - pricing questions, demo requests, and urgency signals drive higher scores."
      }
    },
    {
      "id": "10b4a954-9f75-4a0d-84e3-5f9001bc8d07",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2704,
        -240
      ],
      "parameters": {
        "width": 864,
        "height": 1264,
        "content": "# AI Sales Chatbot: RAG, Lead Capture, Scoring, CRM and DB Sync, and Slack Alerts\n\nTurn your website chat into a lead-generating machine. Visitors chat with an AI that answers questions from your know"
      }
    }
  ],
  "connections": {
    "Reranker": {
      "ai_reranker": [
        [
          {
            "node": "Vector Store",
            "type": "ai_reranker",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings": {
      "ai_embedding": [
        [
          {
            "node": "Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Chat Trigger": {
      "main": [
        [
          {
            "node": "Check Identity In DB",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If Has Leads": {
      "main": [
        [
          {
            "node": "AI Leader Scorer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Vector Store": {
      "ai_tool": [
        [
          {
            "node": "AI Support Specialist",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Get All Leads": {
      "main": [
        [
          {
            "node": "Filter Leads Ready to Score",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Respond to Chat": {
      "main": [
        []
      ]
    },
    "AI Leader Scorer": {
      "main": [
        [
          {
            "node": "Mark as Scored",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Identity In DB": {
      "main": [
        [
          {
            "node": "AI Support Specialist",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Postgres Chat Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Support Specialist",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "AI Support Specialist": {
      "main": [
        [
          {
            "node": "Respond to Chat",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Leader Scorer",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "AI Support Specialist",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Check if Lead Exists in CRM": {
      "ai_tool": [
        [
          {
            "node": "AI Support Specialist",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Filter Leads Ready to Score": {
      "main": [
        [
          {
            "node": "If Has Leads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger - Score Leads": {
      "main": [
        [
          {
            "node": "Get All Leads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append row in Google Sheets CRM": {
      "ai_tool": [
        [
          {
            "node": "AI Support Specialist",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Update row in Google Sheets CRM": {
      "ai_tool": [
        [
          {
            "node": "AI Support Specialist",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Slack Alert - New Lead and Intent": {
      "ai_tool": [
        [
          {
            "node": "AI Support Specialist",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Update row in Google Sheets CRM (2)": {
      "ai_tool": [
        [
          {
            "node": "AI Leader Scorer",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Supabase Upsert - Save User Identity": {
      "ai_tool": [
        [
          {
            "node": "AI Support Specialist",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  }
}