{
  "name": "Complete business WhatsApp AI-powered RAG chatbot using OpenAI",
  "nodes": [
    {
      "id": "5be03c5c-e02d-4770-b0db-795dff0bf84f",
      "name": "Respond to Webhook",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        -60,
        1140
      ]
    },
    {
      "id": "8e24d1bc-8e65-4562-8cc4-4ce9c917841b",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        480,
        1480
      ]
    },
    {
      "id": "22fe09e5-053c-4f80-9e44-71f533492e31",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -340,
        1360
      ],
      "parameters": {
        "width": 459,
        "height": 485,
        "content": "# STEP 4\n\n## RAG System\n\n\n\n\n\n\n\n\n\n\n\n\n\n* *Respond* webhook receives various POST Requests from Meta regarding WhatsApp messages (user messages + status notifications)\n* Check if the incoming JSON contai"
      }
    },
    {
      "id": "cfed3c49-be8a-4d1a-aa3a-5e60a19c00ac",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        480,
        1680
      ]
    },
    {
      "id": "55970db5-284d-40b9-ad6f-f43b513aac45",
      "name": "When clicking ‘Test workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -620,
        200
      ]
    },
    {
      "id": "99de11b0-ab4a-49fe-977b-b3102c9ff1cf",
      "name": "Qdrant Vector Store",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
      "position": [
        360,
        320
      ]
    },
    {
      "id": "619d2d2f-7a1e-49ba-a3ae-24bf24287dd2",
      "name": "Create collection",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -320,
        60
      ]
    },
    {
      "id": "b61d5d74-14d2-4488-a0d6-3f7df9745329",
      "name": "Refresh collection",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -320,
        320
      ]
    },
    {
      "id": "71c8817f-f5be-4900-aecc-14d483993c4c",
      "name": "Get folder",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -100,
        320
      ]
    },
    {
      "id": "c14e570d-527d-4cc2-b0c0-2406b814ffc6",
      "name": "Download Files",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        120,
        320
      ]
    },
    {
      "id": "7f1ffbd5-7aa0-49d3-aa11-9568ac704d6e",
      "name": "Embeddings OpenAI",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        340,
        520
      ]
    },
    {
      "id": "bdc58292-5880-41b9-bc55-d6437f037629",
      "name": "Default Data Loader",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        520,
        520
      ]
    },
    {
      "id": "7df52ba0-011e-44a5-b25d-a4610f903ed9",
      "name": "Token Splitter",
      "type": "@n8n/n8n-nodes-langchain.textSplitterTokenSplitter",
      "position": [
        480,
        680
      ]
    },
    {
      "id": "b3306890-d527-44d9-bd42-2decd61b35a2",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -880,
        1240
      ],
      "parameters": {
        "width": 405,
        "height": 177,
        "content": "## Important!\n### Configure the webhook nodes this way:\n* Make sure that both *Verify* and *Respond* have the same URL\n* *Verify* should have GET HTTP Method\n* *Respond* should have POST HTTP Method"
      }
    },
    {
      "id": "2da39c54-1596-4674-99c5-8fdac7873ea3",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -340,
        900
      ],
      "parameters": {
        "width": 618,
        "height": 392,
        "content": "# STEP 3\n\n## Create Webhook\n* Go to your [Meta for Developers App page](https://developers.facebook.com/apps/), navigate to the App settings\n* Add a **production webhook URL** as a new Callback URL\n* "
      }
    },
    {
      "id": "9c8a18df-d2a9-4d91-a799-a8ee6c5160ba",
      "name": "Verify",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -300,
        1140
      ]
    },
    {
      "id": "1ca39545-9ec1-489d-bcaf-f6289163d3e0",
      "name": "Respond",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -320,
        1520
      ]
    },
    {
      "id": "02ae9009-b34b-49a5-86f2-50e681125d77",
      "name": "is Message?",
      "type": "n8n-nodes-base.if",
      "position": [
        -100,
        1520
      ]
    },
    {
      "id": "9f866e16-cedb-4c43-ab38-e0e53703402a",
      "name": "Only message",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        200,
        1620
      ]
    },
    {
      "id": "3867b8c8-db5f-40f6-b3ae-edf1ab732395",
      "name": "Send",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        900,
        1480
      ]
    },
    {
      "id": "401a8204-4cea-4bd0-9ae7-8c5c6797c586",
      "name": "Window Buffer Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        640,
        1720
      ]
    },
    {
      "id": "ff1ebe0d-b572-4b77-ad67-351c0ec17927",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -120,
        0
      ],
      "parameters": {
        "width": 880,
        "height": 220,
        "content": "# STEP 1\n\n## Create Qdrant Collection\nChange:\n- QDRANTURL\n- COLLECTION"
      }
    },
    {
      "id": "df7bc44c-fb7d-4bc4-bc79-245f53e17eca",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -340,
        260
      ],
      "parameters": {
        "width": 620,
        "height": 400,
        "content": "# STEP 2\n\n\n\n\n\n\n\n\n\n\n\n\n## Documents vectorization with Qdrant and Google Drive\nChange:\n- QDRANTURL\n- COLLECTION"
      }
    },
    {
      "id": "df4f90ab-1cbb-4335-893a-0f3e2a62be04",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        440,
        1360
      ],
      "parameters": {
        "width": 380,
        "height": 260,
        "content": "## Configure AI Agent\nSet System prompt and chat model. If you want you can set any tools"
      }
    },
    {
      "id": "b0928ee4-2c6a-4bc0-a013-15504f157379",
      "name": "OpenAI Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        980,
        1920
      ]
    },
    {
      "id": "16ca729c-9492-4af1-a02f-9b3e5b4ebc43",
      "name": "Retrive Qdrant Vector Store",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
      "position": [
        620,
        1940
      ]
    },
    {
      "id": "c950482d-23e3-4318-a878-f80f8cfee556",
      "name": "Embeddings OpenAI2",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        500,
        2140
      ]
    },
    {
      "id": "46347cfc-b4e7-4627-a991-3f30c12d7f42",
      "name": "RAG",
      "type": "@n8n/n8n-nodes-langchain.toolVectorStore",
      "position": [
        840,
        1700
      ]
    }
  ],
  "connections": {
    "RAG": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Verify": {
      "main": [
        [
          {
            "node": "Respond to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Respond": {
      "main": [
        [
          {
            "node": "is Message?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Send",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get folder": {
      "main": [
        [
          {
            "node": "Download Files",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "is Message?": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Only message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Files": {
      "main": [
        [
          {
            "node": "Qdrant Vector Store",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Token Splitter": {
      "ai_textSplitter": [
        [
          {
            "node": "Default Data Loader",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI": {
      "ai_embedding": [
        [
          {
            "node": "Qdrant Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI2": {
      "ai_embedding": [
        [
          {
            "node": "Retrive Qdrant Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "RAG",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Refresh collection": {
      "main": [
        [
          {
            "node": "Get folder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Default Data Loader": {
      "ai_document": [
        [
          {
            "node": "Qdrant Vector Store",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "Window Buffer Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Retrive Qdrant Vector Store": {
      "ai_vectorStore": [
        [
          {
            "node": "RAG",
            "type": "ai_vectorStore",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Test workflow’": {
      "main": [
        [
          {
            "node": "Create collection",
            "type": "main",
            "index": 0
          },
          {
            "node": "Refresh collection",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}