AI-Powered RAG Document Processing & Chatbot with Google Drive, Supabase, OpenAI
Needs changesWhat this workflow does
This AI workflow has 27 nodes and runs when a chat message arrives (plus 1 other trigger). Along the way it connects Google Drive, Google Gemini Chat Model, Embeddings OpenAI and Supabase Vector Store and 1 more.
How it runs
Trigger: When a chat message arrives (plus 1 other trigger).
- AI Agent: runs an AI agent, with model: OpenAI Chat Model; 1 tool (Supabase Vector Store); memory: Simple Memory
- Loop Over Items (Loop Over Items (Split in Batches)): loops over the items in batches
- Set File ID (Edit Fields (Set)): sets 1 field: file_id
- Download FIle (Google Drive): download
- Switch: routes items into 2 branches
- Extract from PDF (Extract from File): extracts data from a file (pdf)
- Extract from CSV (Extract from File): extracts data from a file
- Document Data (Edit Fields (Set)): sets or maps fields
- Create Metadata Title & Description (Basic LLM Chain): sends a prompt to an LLM, with model: Google Gemini Chat Model; output parser: Structured Output Parser
- Split into chunks (Code): runs custom JavaScript code
…plus 5 more steps. See the full node list below.
Services it uses
Before you upgrade to n8n 3.0
1 thing in this workflow is removed in n8n 3.0. Fix it before you upgrade:
- AI Agent v1 (old agent modes) in AI Agent (v1.8): replace with Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.
| Removed in 3.0 | Replace with |
|---|---|
| AI Agent v1 (old agent modes) AI Agent (v1.8) | Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent. |
Nodes used (21)
- Loop Over Items (Split in Batches)
n8n-nodes-base.splitInBatches - Extract from File
n8n-nodes-base.extractFromFile - Default Data Loader
@n8n/n8n-nodes-langchain.documentDefaultDataLoader - Google Drive Trigger
n8n-nodes-base.googleDriveTrigger - Character Text Splitter
@n8n/n8n-nodes-langchain.textSplitterCharacterTextSplitter - Edit Fields (Set)
n8n-nodes-base.set - Google Drive
n8n-nodes-base.googleDrive - Switch
n8n-nodes-base.switch - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - Google Gemini Chat Model
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - Basic LLM Chain
@n8n/n8n-nodes-langchain.chainLlm - Split Out
n8n-nodes-base.splitOut - Limit
n8n-nodes-base.limit - Summarize
n8n-nodes-base.summarize - Embeddings OpenAI
@n8n/n8n-nodes-langchain.embeddingsOpenAi - Supabase Vector Store
@n8n/n8n-nodes-langchain.vectorStoreSupabase - Code
n8n-nodes-base.code - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - AI Agent
@n8n/n8n-nodes-langchain.agent - Chat Trigger
@n8n/n8n-nodes-langchain.chatTrigger - Simple Memory
@n8n/n8n-nodes-langchain.memoryBufferWindow
From the author
Who is this for? This workflow is perfect for: Businesses and teams who need an automated solution to organize, analyze, and retrieve insights from their internal documents. Researchers who want to quickly analyze and query large collections of research…