Build an advanced WhatsApp RAG chatbot using this powerful n8n workflow. It uses the n8n node ecosystem to integrate Gemini 2.5 Flash, OpenAI embeddings, and Supabase for efficient knowledge retrieval.
Download this n8n workflow template and start using it instantly.
This sophisticated n8n workflow provides a complete solution for deploying a Retrieval-Augmented Generation (RAG) system directly accessible via WhatsApp. The primary challenge this n8n template solves is turning unstructured knowledge (documents uploaded via chat) into structured, queryable data, and then using a state-of-the-art Large Language Model (LLM) to deliver accurate, context-specific answers.
The system features two main components: a Document Flow for ingestion and a Query Flow for retrieval. The Document Flow leverages OpenAI embeddings to vectorize uploaded documents and stores these vectors securely in a Supabase vector database. The Query Flow uses the power of a custom RAG agent in n8n, powered by the Gemini 2.5 Flash LLM, to search the Supabase vectors and formulate an informed response, guaranteeing high accuracy and relevance. This robust n8n workflow showcases the flexibility of the n8n node environment for complex AI tasks.
This n8n workflow begins with the New WhatsApp Message n8n trigger.
Check if Query or Document n8n node immediately evaluates the payload to determine if the message is a text query or a document upload.RAG Query Agent n8n node. This agent is configured to use the powerful Google Gemini LLM and leverages the Retrieve Context from Supabase n8n node as a tool. The tool uses OpenAI embeddings (the same model used for ingestion) to query the Supabase database, fetching the most relevant documents.Send WhatsApp Reply n8n node, completing the automated cycle.To install this specific n8n workflow and run it successfully, follow these steps:
New WhatsApp Message n8n trigger.n8n node parameters. New WhatsApp Message (n8n trigger): The starting point of the n8n workflow. It fires upon receiving any new message (text or document) from a WhatsApp user.
Check if Query or Document (Switch n8n node): Essential core logic flow control. It uses conditional checks (presence of text or document fields) to branch the n8n workflow into RAG Query or Document Ingestion paths.
Get Document URL & Download WhatsApp Document (WhatsApp API & HTTP Request n8n node): Collaboratively handle binary data. They first retrieve the direct media URL and then download the binary file content, ready for processing.
Generate OpenAI Embeddings (n8n node): Crucial for RAG. It takes the text content and creates high-dimensional vector representations using the OpenAI embedding model.
Store Embeddings in Supabase (n8n node): Manages the persistent storage of vector data in the Supabase database, enabling future context retrieval.
Retrieve Context from Supabase (n8n node): Configured as a tool for the RAG Agent. This specialized n8n node performs the vector similarity search against the stored Supabase data based on the user's query embeddings.
Google Gemini LLM (n8n node): Provides the conversational intelligence. This node is connected to the RAG Agent to process the user query and the retrieved context, generating a final, coherent answer.
RAG Query Agent (n8n node): The control center for the RAG process. It orchestrates the use of the Gemini LLM and the Supabase retrieval tool to generate the best possible response.
Leverage this advanced n8n workflow to deploy an AI personal assistant (Jarvis) accessible directly through WhatsApp. Manage Gmail, Google Calendar, Tasks, and Expenses using natural language, featuring transcription and text-to-speech capabilities.

Deploy a dynamic WhatsApp product catalog bot using n8n workflow. Integrate PostgreSQL for conversational state and inventory lookup with this powerful n8n template.

Use this robust n8n workflow to automate outbound WhatsApp messaging triggered by Baserow status updates. Features WasenderAPI integration and rigorous logging using a precise n8n node sequence.

Deploy a powerful n8n workflow template that uses a WhatsApp n8n trigger to feed user ingredients to Google Gemini AI and the FatSecret API for instant, context-aware recipe suggestions.

Deploy a smart, context-aware WhatsApp support bot using this advanced n8n workflow. Integrate Google Sheets for RAG, conversational memory, and automated customer issue logging.

Build an advanced n8n workflow for WhatsApp customer support. Features Google Drive RAG indexing, GPT-4.1-mini AI Agent, memory, and Cohere reranking for safe, professional replies. Deploy high-quality n8n templates.

Exploring AI and automation with n8n. Here to share builds, learn from the community, and create useful workflows together.







































