# AI-Powered RAG Document Processing & Chatbot with Google Drive: n8n workflow

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

Source: https://millionrounds.com/workflow/ai-powered-rag-document-processing-and-chatbot-with-google-d (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [Documents and files](https://millionrounds.com/workflows?category=Documents+and+files#library)

# AI-Powered RAG Document Processing & Chatbot with Google Drive

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

Large Calls a model: Gemini, OpenAI Retrieval

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fai-powered-rag-document-processing-and-chatbot-with-google-d)

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

**1** Branch: places the flow splits

**1** Loop or waits

**2** Services it connects to

## The flow

Starts it 2 Model 14 Logic 7 Service 4

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

- 1 **Google Drive Trigger File Created** Google Drive trigger *Starts it*
- 2 **Character Text Splitter** Text Splitter Character Text Splitter *Model*
- 3 **Structured Output Parser** Output Parser Structured *Model*
- 4 **Google Gemini Chat Model** Lm Chat Google Gemini *Model*
- 5 **Embeddings OpenAI** Embeddings Open Ai *Model*
- 6 **Google Gemini Chat Model1** Lm Chat Google Gemini *Model*
- 7 **OpenAI Chat Model** Lm Chat Open Ai *Model*
- 8 **Embeddings OpenAI1** Embeddings Open Ai *Model*
- 9 **When chat message received** Chat trigger *Starts it*
- 10 **Simple Memory** Memory Buffer Window *Model*
- 11 **Loop Over Items** Split In Batches *Logic*
- 12 **Default Data Loader** Document Default Data Loader *Model*
- 13 **Create Metadata Title & Description** Chain Llm *Model*
- 14 **Process Context** Chain Llm *Model*
- 15 **Add Data to Supabase Vector Store** Vector Store Supabase *Model*
- 16 **AI Agent** Agent *Model*
- 17 **Supabase Vector Store** Vector Store Supabase *Model*
- 18 **Set File ID** Set *Logic*
- 19 **Split into chunks** Code *Logic*
- 20 **Summarize** Summarize *Service*
- 21 **Download FIle** Google Drive *Service*
- 22 **Split Out** Split Out *Logic*
- 23 **Switch** Switch *Logic*
- 24 **Limit** Limit *Logic*
- 25 **Extract from PDF** Extract From File *Service*
- 26 **Extract from CSV** Extract From File *Service*
- 27 **Document Data** Set *Logic*

## How it's built

- **Starts on:** Someone opening a chat with it
- **Steps:** 27, with 1 branch, 1 loop or waits
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Google Drive, Supabase vectors
- **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 Google Drive and Supabase vectors 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 someone opening a chat with it.

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?

Take your time. At 27 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 27 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%2Fai-powered-rag-document-processing-and-chatbot-with-google-d)
- **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)[Supabase vectors](https://millionrounds.com/workflows?service=Supabase+vectors#library)

## Workflows like it

Also documents and files, with the same services where possible, closest in size first.

- [**Translate documents to multiple languages with Google Drive** 27 steps · Gmail, Google Drive](https://millionrounds.com/workflow/translate-documents-to-multiple-languages-with-google-drive)
- [**Chat with Ollama and Supabase Vector DB** 26 steps · calls a model · Google Drive, Supabase](https://millionrounds.com/workflow/chat-with-ollama-and-supabase-vector-db)
- [**Crawl documentation sites and build an AI knowledge base** 26 steps · calls a model · Google Docs, Google Drive](https://millionrounds.com/workflow/crawl-documentation-sites-and-build-an-ai-knowledge-base)
- [**Generate business requirement documents with Google Workspace** 28 steps · calls a model · Google Drive, Google Sheets](https://millionrounds.com/workflow/generate-business-requirement-documents-with-google-workspac)
- [**Index Google Drive files into a Supabase vector store** 26 steps · calls a model · Google Drive, Postgres](https://millionrounds.com/workflow/index-google-drive-files-into-a-supabase-vector-store)
- [**Provide academic OCR and RAG answers on Telegram with Gemini** 28 steps · calls a model · Google Drive, Google Sheets](https://millionrounds.com/workflow/provide-academic-ocr-and-rag-answers-on-telegram-with-gemini)
