← All N8N workflows
AI & researchAgentAggregateChat TriggerDocument Default Data LoaderEmbeddings Open Ai

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.

Workflow preview
Web / APIGet All filesHTTP RequestFiles / mediaDefault Data LoaderDocument Default Data Lo…TransformRecursive CharacterText SplitterText Splitter Recursive …TransformExtract Document PDFExtract From FileAI & modelsEmbeddings OpenAIEmbeddings Open AiData storeCreate File record2SupabaseRoutingIfIfData storeGet All FilesSupabaseWeb / APIDownloadHTTP RequestRoutingLoop Over ItemsLoop Over ItemsTriggerWhen clicking ‘Testworkflow’Manual TriggerTransformAggregateAggregateTriggerWhen chat messagereceivedChat TriggerAI & modelsOpenAI Chat Model1OpenAI Chat ModelAI & modelsEmbeddings OpenAI2Embeddings Open AiAI & modelsOpenAI Chat Model2OpenAI Chat ModelAI & modelsVector Store Tool1Tool Vector StoreRoutingSwitchSwitchData storeInsert into SupabaseVectorstoreVector Store SupabaseTransformMergeMergeAI & modelsAI AgentAgentData storeSupabase Vector StoreVector Store Supabase

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.

Workflow node names, types, and operations
NodeCategoryTypeOperation
Get All filesWeb / APIHTTP RequestPOST
Default Data LoaderFiles / mediaDocument Default Data LoaderSee node parameters
Recursive Character Text SplitterTransformText Splitter Recursive Character Text SplitterSee node parameters
Extract Document PDFTransformExtract From Filepdf
Embeddings OpenAIAI & modelsEmbeddings Open AiSee node parameters
Create File record2Data storeSupabaseSee node parameters
IfRoutingIfSee node parameters
Get All FilesData storeSupabasegetAll
DownloadWeb / APIHTTP RequestSee node parameters
Loop Over ItemsRoutingLoop Over ItemsSee node parameters
When clicking ‘Test workflow’TriggerManual TriggerSee node parameters
AggregateTransformAggregateSee node parameters
When chat message receivedTriggerChat TriggerSee node parameters
OpenAI Chat Model1AI & modelsOpenAI Chat ModelSee node parameters
Embeddings OpenAI2AI & modelsEmbeddings Open AiSee node parameters
OpenAI Chat Model2AI & modelsOpenAI Chat ModelSee node parameters
Vector Store Tool1AI & modelsTool Vector StoreSee node parameters
SwitchRoutingSwitchSee node parameters
Insert into Supabase VectorstoreData storeVector Store SupabaseSee node parameters
MergeTransformMergeSee node parameters
AI AgentAI & modelsAgentSee node parameters
Supabase Vector StoreData storeVector Store SupabaseSee node parameters

Setup

  1. Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
  2. Connect your own credentials through n8n’s credential store. Replace REPLACE_WITH_* values with your resource identifiers.
  3. Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
  4. 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

  • openAiApi
  • supabaseApi

Workflow notes

... or watch set up video [10 min]

... or watch set up video [10 min]

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

  1. 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.
  1. Compare and Filter Files:
  • Aggregate the files retrieved from storage and compare them to the existing list in the Supabase files table.
  • Exclude duplicates and skip placeholder files to ensure only unprocessed files are handled.
  1. 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.
  1. 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.
  1. 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.
  1. 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.
  1. 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.
  1. 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

More in AI & research