# AI agent to chat with Google Drive: n8n workflow template

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

Source: https://millionrounds.com/workflow/ai-agent-to-chat-with-google-drive (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 agent to chat with Google Drive

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

Large Calls a model: OpenAI Retrieval

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fai-agent-to-chat-with-google-drive)

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

**4** Branches: places the flow splits

**3** Loops or waits

**3** Services it connects to

## The flow

Starts it 5 Model 13 Logic 18 Service 13

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

- 1 **Recursive Character Text Splitter** Text Splitter Recursive Character Text Splitter *Model*
- 2 **Embeddings OpenAI** Embeddings Open Ai *Model*
- 3 **When clicking ‘Test workflow’** Manual trigger *Starts it*
- 4 **When chat message received** Chat trigger *Starts it*
- 5 **OpenAI Chat Model** Lm Chat Open Ai *Model*
- 6 **Simple Memory** Memory Buffer Window *Model*
- 7 **Embeddings OpenAI1** Embeddings Open Ai *Model*
- 8 **File Created** Google Drive trigger *Starts it*
- 9 **File Updated** Google Drive trigger *Starts it*
- 10 **Embeddings OpenAI3** Embeddings Open Ai *Model*
- 11 **Recursive Character Text Splitter1** Text Splitter Recursive Character Text Splitter *Model*
- 12 **Webhook** Webhook *Starts it*
- 13 **Default Data Loader** Document Default Data Loader *Model*
- 14 **Insert into Supabase Vectorstore** Vector Store Supabase *Model*
- 15 **Get All Files** Supabase *Service*
- 16 **Edit Fields** Set *Logic*
- 17 **AI Agent1** Agent *Model*
- 18 **Supabase Vector Store** Vector Store Supabase *Model*
- 19 **Set File ID** Set *Logic*
- 20 **Insert into Supabase Vectorstore1** Vector Store Supabase *Model*
- 21 **Default Data Loader1** Document Default Data Loader *Model*
- 22 **Edit Fields1** Set *Logic*
- 23 **Loop Over Items** Split In Batches *Logic*
- 24 **Aggregate** Aggregate *Logic*
- 25 **Merge** Merge *Logic*
- 26 **Delete Old Doc Rows** Supabase *Service*
- 27 **If** If *Logic*
- 28 **Get All files** Http Request *Service*
- 29 **Download File** Google Drive *Service*
- 30 **Download** Http Request *Service*
- 31 **Upload File1** Http Request *Service*
- 32 **If1** If *Logic*
- 33 **Get Processing Status1** Http Request *Service*
- 34 **Upload File** Http Request *Service*
- 35 **Set Text** Set *Logic*
- 36 **Is Job Ready?1** Switch *Logic*
- 37 **Stop and Error1** Stop And Error *Logic*
- 38 **Get Processing Status** Http Request *Service*
- 39 **Merge Text** Merge *Logic*
- 40 **Wait to stay within service limits1** Wait *Logic*
- 41 **Get Parsed Data1** Http Request *Service*
- 42 **Is Job Ready?** Switch *Logic*
- 43 **Stop and Error** Stop And Error *Logic*
- 44 **Create File record2** Supabase *Service*
- 45 **Set Text3** Set *Logic*
- 46 **Wait to stay within service limits** Wait *Logic*
- 47 **Get Parsed Data** Http Request *Service*
- 48 **Create File record1** Supabase *Service*
- 49 **Set Text1** Set *Logic*

## How it's built

- **Starts on:** Someone opening a chat with it
- **Steps:** 49, with 4 branches, 3 loops or waits
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Google Drive, Supabase, Supabase vectors
- **Model:** 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, Supabase and Supabase vectors accounts, and a key for 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 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 49 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 49 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-agent-to-chat-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)[Supabase](https://millionrounds.com/workflows?service=Supabase#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.

- [**Automated document ingestion & vectorization with RAG** 47 steps · calls a model · Google Docs, Google Drive](https://millionrounds.com/workflow/automated-document-ingestion-and-vectorization-with-rag)
- [**Create restorable n8n Docker backups in Google Drive with SSH** 44 steps · Google Drive](https://millionrounds.com/workflow/create-restorable-n8n-docker-backups-in-google-drive-with-ss)
- [**Multimodal Political AI Chatbot for WhatsApp: Text, Voice** 37 steps · calls a model · Google Drive, Pinecone](https://millionrounds.com/workflow/multimodal-political-ai-chatbot-for-whatsapp-text-voice)
- [**Verify onboarding compliance documents with OpenAI** 37 steps · calls a model · Google Drive, Google Sheets](https://millionrounds.com/workflow/verify-onboarding-compliance-documents-with-openai)
- [**My solution for the "Agentic Arena Community Contest" with RAG** 34 steps · calls a model · Google Drive, Qdrant](https://millionrounds.com/workflow/my-solution-for-the-agentic-arena-community-contest-with-rag)
- [**Automate document approvals with Supabase and Gmail** 33 steps · Gmail, Supabase](https://millionrounds.com/workflow/automate-document-approvals-with-supabase-and-gmail)
