# WhatsApp RAG chatbot with Supabase and Gemini: n8n workflow

> Started by an incoming WhatsApp message, and works across Supabase vectors and WhatsApp. It puts Gemini and OpenAI behind a retrieval step, so answers are...

Source: https://millionrounds.com/workflow/whatsapp-rag-chatbot-with-supabase-and-gemini (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [Chat assistants](https://millionrounds.com/workflows?category=Chat+assistants#library)

# WhatsApp RAG chatbot with Supabase and Gemini

Started by an incoming WhatsApp message, and works across Supabase vectors and WhatsApp. It puts Gemini and OpenAI behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 11 steps, 1 branch: a working afternoon to understand properly.

Medium Calls a model: Gemini, OpenAI Retrieval

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fwhatsapp-rag-chatbot-with-supabase-and-gemini)

**11 steps** Medium: a working afternoon

**1** Branch: places the flow splits

**0** Loops or waits

**2** Services it connects to

## The flow

Starts it 1 Model 6 Logic 1 Service 3

The steps in the order they run, from what starts it.

- 1 **New WhatsApp Message** Whats App trigger *Starts it*
- 2 **Convert File to Text** Document Default Data Loader *Model*
- 3 **Generate OpenAI Embeddings** Embeddings Open Ai *Model*
- 4 **Google Gemini LLM** Lm Chat Google Gemini *Model*
- 5 **Check if Query or Document** Switch *Logic*
- 6 **Store Embeddings in Supabase** Vector Store Supabase *Model*
- 7 **Retrieve Context from Supabase** Vector Store Supabase *Model*
- 8 **RAG Query Agent** Agent *Model*
- 9 **Get Document URL** Whats App *Service*
- 10 **Send WhatsApp Reply** Whats App *Service*
- 11 **Download WhatsApp Document** Http Request *Service*

## How it's built

- **Starts on:** An incoming WhatsApp message
- **Steps:** 11, with 1 branch
- **Size:** Medium: a working afternoon
- **Connects to:** Supabase vectors, WhatsApp
- **Model:** Gemini, OpenAI
- **Retrieval:** Answers are drawn from documents you supply, not from the model alone

## Questions

What does it need to run?

An n8n account, plus your own Supabase vectors and WhatsApp accounts, and a key for Gemini and OpenAI. You connect your own accounts after importing it; none are included.

What starts it?

It starts on an incoming WhatsApp message.

Does it use AI?

Yes. It calls Gemini and OpenAI. Its answers draw on documents you give it, not on the model alone. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Plan an afternoon. 11 steps is enough that you should read each one before running it.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

**Before you run it**

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 11 steps before you point it at anything that matters.

## Run it in n8n

- **Create your n8n account** Free to start. n8n is where the workflow runs. [Create an n8n account ↗](https://millionrounds.com/n8n)
- **Download the workflow** Free with a Millionrounds account. [Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fwhatsapp-rag-chatbot-with-supabase-and-gemini)
- **Paste it into n8n** Open a new workflow in n8n and paste. Then connect your own accounts.

Stored with the author's traces removed: canvas notes, instance identifiers, saved credential names and any live document they had left behind.

## Connects to

Each opens the other workflows that use it.

[Supabase vectors](https://millionrounds.com/workflows?service=Supabase+vectors#library)[WhatsApp](https://millionrounds.com/workflows?service=WhatsApp#library)

## Workflows like it

Also chat assistants, with the same services where possible, closest in size first.

- [**Auto-respond to Instagram, Facebook & WhatsApp with Llama** 11 steps · calls a model · WhatsApp](https://millionrounds.com/workflow/auto-respond-to-instagram-facebook-and-whatsapp-with-llama)
- [**Route WhatsApp home-service requests by urgency with Groq** 11 steps · calls a model · Google Sheets, Supabase](https://millionrounds.com/workflow/route-whatsapp-home-service-requests-by-urgency-with-groq)
- [**Nano banana AI product image creator with WhatsApp** 10 steps · calls a model · WhatsApp](https://millionrounds.com/workflow/nano-banana-ai-product-image-creator-with-whatsapp)
- [**AI WhatsApp assistant – smart message responder** 13 steps · calls a model · Google Sheets, WhatsApp](https://millionrounds.com/workflow/ai-whatsapp-assistant-smart-message-responder)
- [**AI biblical studies assistant on WhatsApp with Gemini** 9 steps · calls a model · WhatsApp](https://millionrounds.com/workflow/ai-biblical-studies-assistant-on-whatsapp-with-gemini)
- [**Build a knowledge-based WhatsApp assistant with Gemini** 13 steps · calls a model · Google Docs, Supabase](https://millionrounds.com/workflow/build-a-knowledge-based-whatsapp-assistant-with-gemini)
