Replace Storage name, database ID and credentials.
Configured with Agent, Aggregate, Chat Trigger, Document Default Data Loader, and additional nodes. Review the connections and setup before adapting this template.
Node categories in this workflow
- Web / API
- Files / media
- Transform
- AI & models
- Data store
- Routing
- Trigger
Icons describe general node roles, inferred from node types. Inspect the parameters for the configured action.
Drag to pan; use + and − to zoom. Reconstructed from the exported node positions; nothing runs here. Dashed lines represent non-main connections. Full node names and notes appear below.
How it works
The exported workflow contains the following configured nodes. Their connections are shown above; inspect the JSON for the complete logic, expressions, and external actions.
| Node | Category | Type | Operation |
|---|---|---|---|
| Get All files | Web / API | HTTP Request | POST |
| Default Data Loader | Files / media | Document Default Data Loader | See node parameters |
| Recursive Character Text Splitter | Transform | Text Splitter Recursive Character Text Splitter | See node parameters |
| Extract Document PDF | Transform | Extract From File | |
| Embeddings OpenAI | AI & models | Embeddings Open Ai | See node parameters |
| Create File record2 | Data store | Supabase | See node parameters |
| If | Routing | If | See node parameters |
| Get All Files | Data store | Supabase | getAll |
| Download | Web / API | HTTP Request | See node parameters |
| Loop Over Items | Routing | Loop Over Items | See node parameters |
| When clicking ‘Test workflow’ | Trigger | Manual Trigger | See node parameters |
| Aggregate | Transform | Aggregate | See node parameters |
| When chat message received | Trigger | Chat Trigger | See node parameters |
| OpenAI Chat Model1 | AI & models | OpenAI Chat Model | See node parameters |
| Embeddings OpenAI2 | AI & models | Embeddings Open Ai | See node parameters |
| OpenAI Chat Model2 | AI & models | OpenAI Chat Model | See node parameters |
| Vector Store Tool1 | AI & models | Tool Vector Store | See node parameters |
| Switch | Routing | Switch | See node parameters |
| Insert into Supabase Vectorstore | Data store | Vector Store Supabase | See node parameters |
| Merge | Transform | Merge | See node parameters |
| AI Agent | AI & models | Agent | See node parameters |
| Supabase Vector Store | Data store | Vector Store Supabase | See node parameters |
Setup
- Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
- Connect your own credentials through n8n’s credential store. Replace
REPLACE_WITH_*values with your resource identifiers. - Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
- Run with synthetic data and harmless destinations. Enable triggers only after checking the actual outputs.
Requirements
An n8n instance with the listed node types and compatible versions. Service-connected workflows may require accounts, credentials, or paid APIs.
Credential types declared in the source
openAiApisupabaseApi
Workflow notes
AI Agent To Chat With Files In Supabase Storage
AI Agent To Chat With Files In Supabase Storage
Made by Mark Shcherbakov from community 5minAI
Manually retrieving and analyzing specific information from large document repositories is time-consuming and inefficient. This workflow automates the process by vectorizing documents and enabling AI-powered interactions, making it easy to query and retrieve context-based information from uploaded files.
The workflow integrates Supabase with an AI-powered chatbot to process, store, and query text and PDF files. The steps include:
- Fetching and comparing files to avoid duplicate processing.
- Handling file downloads and extracting content based on the file type.
- Converting documents into vectorized data for contextual information retrieval.
- Storing and querying vectorized data from a Supabase vector store.
Set up steps
Set up steps
- Fetch File List from Supabase:
- Use Supabase to retrieve the stored file list from a specified bucket.
- Add logic to manage empty folder placeholders returned by Supabase, avoiding incorrect processing.
- Compare and Filter Files:
- Aggregate the files retrieved from storage and compare them to the existing list in the Supabase
filestable. - Exclude duplicates and skip placeholder files to ensure only unprocessed files are handled.
- Handle File Downloads:
- Download new files using detailed storage configurations for public/private access.
- Adjust the storage settings and GET requests to match your Supabase setup.
- File Type Processing:
- Use a Switch node to target specific file types (e.g., PDFs or text files).
- Employ relevant tools to process the content:
- For PDFs, extract embedded content.
- For text files, directly process the text data.
- Content Chunking:
- Break large text data into smaller chunks using the Text Splitter node.
- Define chunk size (default: 500 tokens) and overlap to retain necessary context across chunks.
- Vector Embedding Creation:
- Generate vectorized embeddings for the processed content using OpenAI's embedding tools.
- Ensure metadata, such as file ID, is included for easy data retrieval.
- Store Vectorized Data:
- Save the vectorized information into a dedicated Supabase vector store.
- Use the default schema and table provided by Supabase for seamless setup.
- AI Chatbot Integration:
- Add a chatbot node to handle user input and retrieve relevant document chunks.
- Use metadata like file ID for targeted queries, especially when multiple documents are involved.
Replace Storage name, database ID and credentials.
Replace Storage name, database ID and credentials.
Purpose and structure
This folder contains the Replace Storage name, database ID and credentials. workflow. Its executable nodes use agent, aggregate, chatTrigger, documentDefaultDataLoader, embeddingsOpenAi, extractFromFile, httpRequest, if, lmChatOpenAi, manualTrigger, merge, splitInBatches, supabase, switch, textSplitterRecursiveCharacterTextSplitter, toolVectorStore, vectorStoreSupabase. The table and connection map below are derived from the JSON, not an inferred guarantee of behavior.
Setup
Import inactive. Configure your own credentials and replace REPLACE_WITH_* values. Review external destinations and Code nodes before running.
Entry points
When clicking ‘Test workflow’, When chat message received
Verification
Sanitized source candidate; not runtime-tested. This overview is generated from node metadata. Read the folder README for the connection map, credential types, and license.
Attribution
https://github.com/Zie619/n8n-workflows/blob/94007c1445d9258a7da116646b79473e7c7c3282/workflows/Extractfromfile/1246_Extractfromfile_HTTP_Automation_Webhook.json MIT; preserve source notices.
Canvas section labels
These name areas of the original canvas; they do not include explanatory instructions.
- Replace Storage name, database ID and credentials.
- Replace credentials.
- Scenario 2 - AI agent
- Scenario 1 - Flow for adding new files from Supabase storage