Keep RAG system updated with Google Drive file changes to Supabase vector DB
Ready for 3.0What this workflow does
This AI workflow has 20 nodes and runs on Google Drive events (file updated). Along the way it connects Supabase, Google Drive, Embeddings OpenAI and Supabase Vector Store and 1 more.
How it runs
Trigger: On Google Drive events (file updated).
- Set File ID (Edit Fields (Set)): sets 2 fields: file_id, file_type
- If: checks a condition and branches into true / false
- Delete Old Doc Rows (Supabase): delete
- Limit: keeps the first few items
- Set Version (OpenAI): uses OpenAI
- Loop Over Items (Loop Over Items (Split in Batches)): loops over the items in batches
- Switch: routes items into 6 branches
- Download File (Google Drive): download
- Extract PDF Text (Extract from File): extracts data from a file (pdf)
- Extract from Text File (Extract from File): extracts data from a file (text)
…plus 6 more steps. See the full node list below.
Services it uses
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (17)
- Edit Fields (Set)
n8n-nodes-base.set - Supabase
n8n-nodes-base.supabase - Google Drive
n8n-nodes-base.googleDrive - If
n8n-nodes-base.if - Aggregate
n8n-nodes-base.aggregate - Summarize
n8n-nodes-base.summarize - Extract from File
n8n-nodes-base.extractFromFile - HTTP Request
n8n-nodes-base.httpRequest - Recursive Character Text Splitter
@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter - Embeddings OpenAI
@n8n/n8n-nodes-langchain.embeddingsOpenAi - Default Data Loader
@n8n/n8n-nodes-langchain.documentDefaultDataLoader - Loop Over Items (Split in Batches)
n8n-nodes-base.splitInBatches - Google Drive Trigger
n8n-nodes-base.googleDriveTrigger - Supabase Vector Store
@n8n/n8n-nodes-langchain.vectorStoreSupabase - Switch
n8n-nodes-base.switch - Limit
n8n-nodes-base.limit - OpenAI
@n8n/n8n-nodes-langchain.openAi
From the author
This n8n workflow ensures data freshness in the RAG system by handling modifications to existing files. It complements the "Document Ingestion" workflow by triggering whenever a file in the monitored Google Drive folder is updated. This…