Sync Supabase Storage files into a chat agent with Supabase vectors and OpenAI
Needs changesWhat this workflow does
This AI workflow has 22 nodes and runs when a chat message arrives (plus 1 other trigger). Along the way it connects Embeddings OpenAI, Supabase, OpenAI Chat Model and Vector Store Question Answer 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 (Vector Store Tool)
- Get All Files (Supabase): get many
- Aggregate: combines items into one
- Get All files (HTTP Request): calls an HTTP API (POST)
- Loop Over Items (Loop Over Items (Split in Batches)): loops over the items in batches
- If: checks a condition and branches into true / false
- Download (HTTP Request): calls an HTTP API
- Switch: routes items into 2 branches
- Merge: merges the data from its input branches
- Extract Document PDF (Extract from File): extracts data from a file (pdf)
…plus 2 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.7): replace with Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.
Rather not rewrite it? Many of these flows can be rebuilt in Make (free plan).
| Removed in 3.0 | Replace with |
|---|---|
| AI Agent v1 (old agent modes) AI Agent (v1.7) | Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent. |
Nodes used (17)
- HTTP Request
n8n-nodes-base.httpRequest - Default Data Loader
@n8n/n8n-nodes-langchain.documentDefaultDataLoader - Recursive Character Text Splitter
@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter - Extract from File
n8n-nodes-base.extractFromFile - Embeddings OpenAI
@n8n/n8n-nodes-langchain.embeddingsOpenAi - Supabase
n8n-nodes-base.supabase - If
n8n-nodes-base.if - Loop Over Items (Split in Batches)
n8n-nodes-base.splitInBatches - Manual Trigger
n8n-nodes-base.manualTrigger - Aggregate
n8n-nodes-base.aggregate - Chat Trigger
@n8n/n8n-nodes-langchain.chatTrigger - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Vector Store Question Answer Tool
@n8n/n8n-nodes-langchain.toolVectorStore - Switch
n8n-nodes-base.switch - Supabase Vector Store
@n8n/n8n-nodes-langchain.vectorStoreSupabase - Merge
n8n-nodes-base.merge - AI Agent
@n8n/n8n-nodes-langchain.agent
From the author
Quick overview This workflow syncs files from Supabase Storage into a Supabase vector store using OpenAI embeddings, then exposes an n8n chat trigger where an AI agent answers questions by retrieving relevant document chunks from Supabase. How it works 1.…