# Create a self-updating RAG chatbot with Google Drive: n8n workflow

> Started by someone opening a chat with it, and works across Google Drive, Postgres, Supabase and Supabase vectors.

Source: https://millionrounds.com/workflow/create-a-self-updating-rag-chatbot-with-google-drive (Millionrounds; every figure on the page links to its filing or article)

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

# Create a self-updating RAG chatbot with Google Drive

Started by someone opening a chat with it, and works across Google Drive, Postgres, Supabase and Supabase vectors. It puts Gemini behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 34 steps, 1 branch, 1 loop or waits: large, and worth reading before you trust it with anything live.

Large Calls a model: Gemini Retrieval

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fcreate-a-self-updating-rag-chatbot-with-google-drive)

**34 steps** Large: read it before trusting it with anything live

**1** Branch: places the flow splits

**1** Loop or waits

**4** Services it connects to

## The flow

Starts it 5 Model 10 Logic 7 Service 12

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

- 1 **Reranker Cohere** Reranker Cohere *Model*
- 2 **File Created** Google Drive trigger *Starts it*
- 3 **File Updated** Google Drive trigger *Starts it*
- 4 **Character Text Splitter** Text Splitter Character Text Splitter *Model*
- 5 **Schedule Trigger** Schedule trigger *Starts it*
- 6 **When clicking ‘Test workflow’** Manual trigger *Starts it*
- 7 **Postgres Chat Memory** Memory Postgres Chat *Model*
- 8 **When chat message received** Chat trigger *Starts it*
- 9 **Google Gemini Chat Model** Lm Chat Google Gemini *Model*
- 10 **Embeddings Google Gemini** Embeddings Google Gemini *Model*
- 11 **Embeddings Google Gemini1** Embeddings Google Gemini *Model*
- 12 **Supabase Vector Store** Vector Store Supabase *Model*
- 13 **Loop Over Items** Split In Batches *Logic*
- 14 **Default Data Loader1** Document Default Data Loader *Model*
- 15 **Get File IDs** Google Drive *Service*
- 16 **Supabase** Supabase *Service*
- 17 **Get File IDs2** Google Drive *Service*
- 18 **Supabase2** Supabase *Service*
- 19 **Search files and folders** Google Drive *Service*
- 20 **RAG Agent** Agent *Model*
- 21 **Insert into Supabase Vectorstore** Vector Store Supabase *Model*
- 22 **Set File ID** Set *Logic*
- 23 **Merge** Merge *Logic*
- 24 **Merge2** Merge *Logic*
- 25 **Delete Old Doc Rows** Supabase *Service*
- 26 **Code1** Code *Logic*
- 27 **Code2** Code *Logic*
- 28 **Insert Document Metadata** Postgres *Service*
- 29 **Delete Rows** Supabase *Service*
- 30 **Delete Rows2** Supabase *Service*
- 31 **Download File1** Google Drive *Service*
- 32 **Switch** Switch *Logic*
- 33 **Extract PDF Text** Extract From File *Service*
- 34 **Extract Document Text** Extract From File *Service*

## How it's built

- **Starts on:** Someone opening a chat with it
- **Steps:** 34, with 1 branch, 1 loop or waits
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Google Drive, Postgres, Supabase, Supabase vectors
- **Model:** Gemini
- **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 Google Drive, Postgres, Supabase and Supabase vectors accounts, and a key for Gemini. You connect your own accounts after importing it; none are included.

What starts it?

It starts on someone opening a chat with it.

Does it use AI?

Yes. It calls Gemini. 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?

Take your time. At 34 steps it is large: read it before trusting it with anything live.

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 34 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%2Fcreate-a-self-updating-rag-chatbot-with-google-drive)
- **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.

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

## Workflows like it

Also data collection, with the same services where possible, closest in size first.

- [**Build a Google Drive internal knowledge base with OpenAI** 34 steps · calls a model · Gmail, Google Drive](https://millionrounds.com/workflow/build-a-google-drive-internal-knowledge-base-with-openai)
- [**Websites into a conversational knowledge base with OpenAI RAG** 34 steps · calls a model · Supabase, Supabase vectors](https://millionrounds.com/workflow/websites-into-a-conversational-knowledge-base-with-openai-ra)
- [**24/7 shorts automation system for busy people with OpenRouter** 33 steps · calls a model · Google Drive, Google Sheets](https://millionrounds.com/workflow/24-7-shorts-automation-system-for-busy-people-with-openroute)
- [**AI chatbot call center: Taxi service with Grok and Postgres** 33 steps · calls a model · Postgres, Redis](https://millionrounds.com/workflow/ai-chatbot-call-center-taxi-service-with-grok-and-postgres)
- [**From sitemap crawling to vector storage: Creating an efficient** 35 steps · calls a model · Postgres, Supabase](https://millionrounds.com/workflow/from-sitemap-crawling-to-vector-storage-creating-an-efficien)
- [**Build an omnichannel OTP verification flow with Postgres** 33 steps · Email, Postgres](https://millionrounds.com/workflow/build-an-omnichannel-otp-verification-flow-with-postgres)
