# Index Google Drive files into a Supabase vector store: 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/index-google-drive-files-into-a-supabase-vector-store (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)

# Index Google Drive files into a Supabase vector store

Started by someone opening a chat with it, and works across Google Drive, Postgres, 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. 26 steps, 1 branch, 1 loop 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%2Findex-google-drive-files-into-a-supabase-vector-store)

**26 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 3 Model 4 Logic 5 Service 14

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

- 1 **OpenAI Embeddings** Embeddings Open Ai *Model*
- 2 **When Drive File Created** Google Drive trigger *Starts it*
- 3 **When Drive File Updated** Google Drive trigger *Starts it*
- 4 **Split Text into Chunks** Text Splitter Character Text Splitter *Model*
- 5 **When Chat Message Received** Chat trigger *Starts it*
- 6 **Insert Embeddings to Vectorstore** Vector Store Supabase *Model*
- 7 **Loop Over Drive Files** Split In Batches *Logic*
- 8 **Load Document Data** Document Default Data Loader *Model*
- 9 **Create Docs Table and Match Fn** Postgres *Service*
- 10 **Set File Metadata Fields** Set *Logic*
- 11 **Create Document Metadata Table** Postgres *Service*
- 12 **Delete Old Doc Rows in Supabase** Supabase *Service*
- 13 **Create Document Rows Table** Postgres *Service*
- 14 **Delete Old Data Rows in Supabase** Supabase *Service*
- 15 **Insert Document Metadata to DB** Postgres *Service*
- 16 **Download File from Drive** Google Drive *Service*
- 17 **Route by File Type** Switch *Logic*
- 18 **Extract Text from PDF** Extract From File *Service*
- 19 **Extract Data from Excel** Extract From File *Service*
- 20 **Extract Data from CSV** Extract From File *Service*
- 21 **Extract Text from Document** Extract From File *Service*
- 22 **Aggregate Tabular Data** Aggregate *Logic*
- 23 **Insert Table Rows to DB** Postgres *Service*
- 24 **Summarize Tabular Data** Summarize *Service*
- 25 **Build Schema and Data** Set *Logic*
- 26 **Update Document Schema in DB** Postgres *Service*

## How it's built

- **Starts on:** Someone opening a chat with it
- **Steps:** 26, 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:** 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, Postgres, 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 26 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 26 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%2Findex-google-drive-files-into-a-supabase-vector-store)
- **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 documents and files, with the same services where possible, closest in size first.

- [**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)
- [**Archive HR and legal documents with UploadToURL** 26 steps · Airtable, Gmail](https://millionrounds.com/workflow/archive-hr-and-legal-documents-with-uploadtourl)
- [**AI-Powered RAG Document Processing & Chatbot with Google Drive** 27 steps · calls a model · Google Drive, Supabase vectors](https://millionrounds.com/workflow/ai-powered-rag-document-processing-and-chatbot-with-google-d)
- [**Document RAG & chat agent: Google Drive to Qdrant with Mistral** 25 steps · calls a model · Google Drive, Qdrant](https://millionrounds.com/workflow/document-rag-and-chat-agent-google-drive-to-qdrant-with-mist)
- [**Review contract risk and rewrite clauses with Groq** 25 steps · calls a model · Google Drive, Notion](https://millionrounds.com/workflow/review-contract-risk-and-rewrite-clauses-with-groq)
