Business WhatsApp AI RAG Chatbot n8n Workflow Template

n8n workflow template · 18 nodes · OpenAI

Business WhatsApp AI RAG Chatbot is a free n8n workflow template that starts when its webhook receives an HTTP request and works with OpenAI, Qdrant, Google Drive and WhatsApp Business Cloud. It has 18 nodes, 7 of them AI nodes (AI Agent, OpenAI Chat Model, Qdrant Vector Store and OpenAI Embeddings). To run it, you add your own credentials for Google Drive OAuth2, HTTP Header Auth, OpenAI API, Qdrant API and WhatsApp Business Cloud API.

At a glance

Trigger
Webhook (Verify)
Nodes
18
Apps
OpenAI, Qdrant, Google Drive and WhatsApp Business Cloud
AI nodes
7
Credentials
5 types
Category
RAG, documents and vector search

Apps and integrations

  • OpenAI
  • Qdrant
  • Google Drive
  • WhatsApp Business Cloud

Node types used

  • Respond to Webhook
  • AI Agent
  • OpenAI Chat Model
  • Manual Trigger
  • Qdrant Vector Store
  • HTTP Request
  • Google Drive
  • OpenAI Embeddings
  • Default Data Loader
  • Token Splitter
  • Webhook
  • If
  • WhatsApp Business Cloud
  • Window Buffer Memory

How it works

The text below comes from the sticky notes inside the workflow. We removed links, code samples and anything that looks like a key or token.

STEP 2

Documents vectorization with Qdrant and Google Drive

STEP 3

Create Webhook

  • Go to your Meta for Developers App page, navigate to the App settings
  • Add a production webhook URL as a new Callback URL
  • Verify webhook receives a GET Request and sends back a verification code
  • After that you can delete this

STEP 4

RAG System

  • Respond webhook receives various POST Requests from Meta regarding WhatsApp messages (user messages + status notifications)
  • Check if the incoming JSON contains user message
  • Echo back the text message to the user. This is a custom message, not a WhatsApp Business template message

STEP 1

Create Qdrant Collection

Setup notes

The text below comes from the sticky notes inside the workflow. We removed links, code samples and anything that looks like a key or token.

Important!

Configure the webhook nodes this way

  • Make sure that both Verify and Respond have the same URL
  • Verify should have GET HTTP Method
  • Respond should have POST HTTP Method

Configure AI Agent

Set System prompt and chat model. If you want you can set any tools

Nodes in this workflow

The 18 nodes in file order (sticky notes excluded). Branches and connections determine execution order in n8n:

  1. Respond to Webhook (Respond to Webhook)
  2. AI Agent (AI Agent)
  3. OpenAI Chat Model (OpenAI Chat Model)
  4. When clicking ‘Test workflow’ (Manual Trigger)
  5. Qdrant Vector Store (Qdrant Vector Store)
  6. Create collection (HTTP Request)
  7. Refresh collection (HTTP Request)
  8. Get folder (Google Drive)
  9. Download Files (Google Drive)
  10. Embeddings OpenAI (OpenAI Embeddings)
  11. Default Data Loader (Default Data Loader)
  12. Token Splitter (Token Splitter)
  13. Verify (Webhook)
  14. Respond (Webhook)
  15. is Message? (If)
  16. Only message (WhatsApp Business Cloud)
  17. Send (WhatsApp Business Cloud)
  18. Window Buffer Memory (Window Buffer Memory)

Credentials you need

  • Google Drive OAuth2 – used by Download Files and Get folder
  • HTTP Header Auth – used by Create collection and Refresh collection
  • OpenAI API – used by Embeddings OpenAI and OpenAI Chat Model
  • Qdrant API – used by Qdrant Vector Store
  • WhatsApp Business Cloud API – used by Only message and Send

Configure your own credentials after importing. Create each credential in n8n, then select it in the node.

How to import into n8n

  1. Download the JSON file with the button above.
  2. In n8n, open a new workflow, select the ... menu and choose Import from File. You can also paste the JSON straight into the editor canvas.
  3. Open each node that shows a warning and select or create its credential.
  4. Read the notes on the canvas, test the workflow with sample data, then activate it.

Do you need somewhere to run it? Read our guide to self-hosted n8n.

Need this customised?

We can adapt this workflow to your apps, data and process, then deploy and support it.

Contact Us