Mindket

Chat with the PDF and text files in a Supabase bucket

Newversion 1 · updated

Overview

An n8n workflow that reads the PDF and text files in a Supabase storage bucket, stores their text as OpenAI embeddings in a Supabase table, and gives you a chat agent that answers from them.

Chat with the PDF and text files in a Supabase bucket is an n8n workflow in the Productivity category, listed by Mindket. It is free. This is version 1, last updated on . Download it on this page or copy its JSON, then import it into an n8n canvas. Nothing runs until you activate it in n8n.

At a glance

Runs in
  • n8n Cloud: import the file into a new workflow there
  • Your own n8n server: the same file and steps
  • Supabase: the bucket, the files table and the vector table all live in one project
  • A shared chat: turn on Make Chat Publicly Available in When chat message received and set its authentication

Platform

Connects 2 apps

How it works

Trigger

Test button and chat message

It has two starting points:

  • The Test workflow button, which reads the bucket’s new files
  • A message in n8n’s chat, which asks about them

Actions

  1. The files table and the bucket’s file list are read, and only files not yet recorded go on
  2. Each new file is downloaded, and a PDF has its text extracted
  3. The file is recorded in the files table
  4. The text is cut into pieces of 500 characters and OpenAI turns each into an embedding
  5. The pieces are stored in the Supabase vector table with the file’s id
  6. In the chat, an agent searches the 8 closest pieces and answers from them

Result

Chat answers drawn from your bucket’s PDF and text files, with each file recorded once and its text stored as vectors

Integrations

What you need before you start.

OpenAI

Embeddings and chat

Runs text-embedding-3-small to turn each piece into a vector, and two chat models for the agent and its knowledge tool.

NeedsOpenAI API key

Supabase

Storage, tables and vectors

Holds the bucket, lists and downloads its files, records each file in a table and stores and searches the vectors.

NeedsYour project’s URL and a secret key, with a bucket, two tables and a match function

Workflow check

Checked by Mindket on 13 Nov 2026

Steps
14 steps, starting by hand or on a chat message
AI
2 steps call an AI model: Insert into Supabase Vectorstore and AI Agent
Sign-ins
Signs in to: Supabase and OpenAI
API keys
No API key is left in the file
Step types
Mindket’s checker reads all 12 of its step types

Read from the workflow’s file, not from a run.

About

What it is

This n8n workflow lets you chat with the files in a Supabase storage bucket. Its first half reads the bucket. It lists the files, skips any that a files table already records, downloads the rest and pulls the text out of PDFs and plain text files. The text is cut into pieces of 500 characters, and OpenAI turns each piece into an embedding stored in a Supabase table. Its second half is a chat agent with a knowledge tool that searches those pieces and answers from what it finds. Twenty-two nodes do the work, beside nine sticky notes.

Who it suits

Teams that keep contracts, manuals or reports in Supabase storage and want to ask about them in plain words, and that already run a Supabase project. Skip it if your files are Word documents or images, or if people without n8n should use the chat. It opens only inside the n8n editor.

Who uses it, and how
IndustryWho uses itHow they use itExample
OperationsOffice managersAsk what a stored contract says about renewalA manager asks when notice is due before a lease ends.
Customer supportSupport leadsSearch product manuals kept in a bucketA lead asks which models a warranty note covers.
LegalParalegalsLook up a clause across stored PDFs before opening each oneA paralegal asks which agreements set a data retention period.
EducationCourse teamsLet staff question lecture notes and handoutsA coordinator asks where a syllabus fixes the assessment dates.

You need solid n8n for this one: a Supabase project with a bucket and two tables, a vector function and six nodes pointed at your Supabase credential.

Where to use it

Any n8n that can reach Supabase and OpenAI will run it. The text of every file ends up in your Supabase project, and the chat answers inside n8n.

  • n8n Cloud: import the file into a new workflow there
  • Your own n8n server: the same file and steps
  • Supabase: the bucket, the files table and the vector table all live in one project
  • A shared chat: turn on Make Chat Publicly Available in When chat message received and set its authentication

Setup

Download saves a zip with workflow.json and Mindket’s setup notes in your downloads folder. Build the Supabase side first.

What you need first
NeedDetail
n8nOn n8n Cloud or on a server of your own
SupabaseA project with a storage bucket named private, a table files with name and storage_id columns, and a table documents with a match_documents function
OpenAIAn API key. The embeddings use text-embedding-3-small, and the chat models take their node’s default
FilesPDFs or plain text files in the bucket
  1. In n8n, create a workflow, open its menu, choose Import from File and pick workflow.json.
  2. In Supabase, create the bucket, the files table and the documents table with its match_documents function. The vectors are 1536 numbers long, the size text-embedding-3-small returns.
  3. Add a Supabase API credential with your project’s URL and a secret key. Select it in Get All Files, Create File record2, Insert into Supabase Vectorstore and Supabase Vector Store. In the HTTP nodes Get All files and Download, pick the Supabase credential type and the same credential.
  4. In those two HTTP nodes, replace <YOUR_SUPABASE_PROJECT_REF> in the address with your project reference, the part before .supabase.co. If your bucket has another name, change private in both.
  5. Add an OpenAI credential and select it in Embeddings OpenAI, Embeddings OpenAI2, OpenAI Chat Model1 and OpenAI Chat Model2.
  6. Put a PDF and a text file in the bucket, run the workflow from When clicking ‘Test workflow’ and check that files and documents gain rows.
  7. In Supabase Vector Store, replace <YOUR_FILE_ID> with the id of a row in files to answer from that one file, or remove the metadata filter to search every file.
  8. Save, press Chat on the canvas and ask about a file.

How to use it

Run the first half whenever you add files. It reads only files that files does not list yet. Then ask the chat about them. The agent calls its knowledge tool, which returns the 8 closest pieces, and answers from those.

What to change for a different result
To changeWhere
Which files are readThe two rules in Switch
Piece sizechunkSize 500 and chunkOverlap 200 in Recursive Character Text Splitter
Pieces per questiontopK, 8, in Vector Store Tool1
The embedding modeltext-embedding-3-small in both embedding nodes, which must match
The chat agentThe models in OpenAI Chat Model1 and OpenAI Chat Model2, and the tool’s name and description

Example

An office manager puts two lease PDFs and a text file of building rules in the bucket. She runs the first half once, then asks the chat when notice is due before a lease ends.

Each file gets a row in files, and the pieces of its text go into documents with the row’s id as file_id. The agent searches for the 8 closest pieces and answers from them. Check any date or figure against the file before you act on it.

For newcomers and experts

If you are new. n8n draws a workflow as boxes joined by lines, and each box, a node, does one job. The upper band, Scenario 1, fills the knowledge base. The lower band, Scenario 2, is the chat. Start with one small file and check that its text lands in documents before you ask anything.

For experts. A loop handles one file at a time, and If decides a file is new by looking for its storage_id in the rows Aggregate collected.

Where to look closer
NodeWhat it doesWhat to know
Get All filesPOSTs to the bucket’s list endpoint with a limit of 100 and an offset of 0, sorted by nameOnly the first 100 files are seen
Get All FilesReads the files table with n8n’s default limit of 50 rowsPast 50 rows, older files look new and are added again
IfLets a file through when it is not in files and is not .emptyFolderPlaceholderOther files return to the loop
Switchtxt for a download with no file extension in its binary data, pdf for a PDFAny other type matches neither rule, so the loop stops
Default Data LoaderReads data or text and stamps each piece with the row’s id as file_idThe chat’s metadata filter uses that field

Good to know

Only PDFs and plain text files are meant to pass, and two limits cap how many files it keeps straight.

  • Models: the two chat model nodes set no model, so they take the node’s own default, gpt-5-mini in n8n’s repository on 12 November 2026. OpenAI’s deprecations page, read that day, gives 14 January 2027 as the shutdown of gpt-4o and gpt-4o-mini, with gpt-6-luna as the replacement. If your n8n offers an older default, pick a model in each node
  • File types: a Word file or an image matches no rule of Switch, so nothing returns to the loop and the run stops with later files unread. Keep to PDFs and text
  • Limits: only the first 100 files in the bucket are seen, and Get All Files has Return All off, so n8n reads 50 rows of files. Turn on Return All in that node
  • Repeats: each file goes in once. To read a file again, delete its row in files and its pieces in documents first
  • The filter: with <YOUR_FILE_ID> replaced, the chat sees one file. Remove the filter to search every file
  • Billing: OpenAI bills the embeddings for every piece of each new file, and each question takes an agent call plus a call for the knowledge tool
  • Your data: the text of each file goes to OpenAI and into your Supabase project. Your questions go to OpenAI
  • Keys: the Supabase credential holds a secret key, so use a project meant for this
  • Credentials: the JSON holds none, and it names no project of its author’s

README and files

README

Chat with the PDF and text files in a Supabase bucket

An n8n workflow in two halves. The first reads the PDF and text files in a Supabase storage bucket, cuts their text into
pieces and stores each piece as an OpenAI embedding in a Supabase table. The second is a chat agent that searches those
pieces and answers from them.

What is inside

  • workflow.json: the workflow as n8n exports it, 31 nodes, nine of them sticky notes. It holds no credential. Six notes
    remind you to replace credentials, two name the halves, Scenario 1 for the files and Scenario 2 for the chat, and one
    gives the workflow's title.
  • README.md: these notes.

What we changed from the original copy

  • Every node was linked to a credential in its author's n8n. The links are gone, so select your own.
  • Get All files and Download held the address of their author's Supabase project. It now reads
    <YOUR_SUPABASE_PROJECT_REF>.supabase.co.
  • Supabase Vector Store filtered on one file's id from its author's database. It now reads <YOUR_FILE_ID>.
  • Three sticky notes carried their author's promotion, a video link and setup steps. One now holds a short title, and the
    other two are gone.
  • The original copy had no settings block. Mindket's sets the execution order to v1.
  • Nothing else. The file has no Code node, and its expressions needed no repair.

Before you start

  • An n8n instance, on n8n Cloud or your own server.
  • A Supabase project with a storage bucket named private, holding PDFs or plain text files.
  • A table files with the text columns name and storage_id.
  • A table documents and a match_documents function, set up the way n8n's Supabase vector store expects. The table has
    content, metadata and embedding columns, and the embedding is 1536 numbers long, the size text-embedding-3-small
    returns.
  • An OpenAI API key.

Set it up

  1. In n8n, create a workflow, open its menu and choose Import from File. Pick workflow.json.
  2. Create the bucket, the files table and the documents table with its function in Supabase.
  3. Add a Supabase API credential with your project's URL and a secret key. Select it in Get All Files,
    Create File record2, Insert into Supabase Vectorstore and Supabase Vector Store. In Get All files and
    Download, which are HTTP requests, pick the Supabase credential type and the same credential.
  4. In Get All files and Download, replace <YOUR_SUPABASE_PROJECT_REF> in the address with your project reference,
    the part before .supabase.co. If your bucket has another name, change private in both addresses.
  5. Add an OpenAI credential and select it in Embeddings OpenAI, Embeddings OpenAI2, OpenAI Chat Model1 and
    OpenAI Chat Model2.
  6. Put one PDF and one text file in the bucket. Run the workflow from When clicking ‘Test workflow’, then check that
    files and documents gained rows.
  7. In Supabase Vector Store, replace <YOUR_FILE_ID> with the id of a row in files to answer from that one file, or
    remove the metadata filter to search every file.
  8. Save, press Chat on the canvas and ask a question about a file.

How a run goes

Scenario 1, the files:

  1. Get All Files reads the files table and Aggregate folds its rows into one list.
  2. Get All files asks Supabase Storage for the bucket's file list, 100 files at most, sorted by name.
  3. Loop Over Items takes one file at a time. If lets it through when no row in files has its storage_id and its
    name is not .emptyFolderPlaceholder. A file that fails goes back to the loop.
  4. Download fetches the file. Switch sends a download with no file extension in its binary data, a text file, down
    the txt output, and a PDF down the pdf output through Extract Document PDF. Merge joins the two.
  5. Create File record2 adds the file to files. Insert into Supabase Vectorstore then stores its text. `Default Data
    Loader reads data for a text file or text for a PDF and stamps each piece with the row's id as file_id`.
    Recursive Character Text Splitter cuts the text into pieces of 500 characters that overlap by 200, and
    Embeddings OpenAI turns each into a vector. The loop then moves on.

Scenario 2, the chat:

  1. When chat message received takes your message. AI Agent answers it, with OpenAI Chat Model1 as its model.
  2. Its one tool, Vector Store Tool1, is named knowledge_base. It searches Supabase Vector Store through
    Embeddings OpenAI2 and returns the 8 closest pieces, and OpenAI Chat Model2 reads them for the tool.

Change the look

  • Which files are read: the two rules in Switch.
  • Piece size: chunkSize and chunkOverlap in Recursive Character Text Splitter.
  • Pieces per question: topK in Vector Store Tool1.
  • The embedding model: text-embedding-3-small in both embedding nodes. Keep them the same, and keep the table's vector
    size to match.
  • The chat: the models in OpenAI Chat Model1 and OpenAI Chat Model2, and the tool's name and description.

Good to know

  • Models: the two chat model nodes set no model, so they take the node's own default, gpt-5-mini in n8n's repository on
    12 November 2026. OpenAI's deprecations page, read that day, gives 14 January 2027 as the shutdown of gpt-4o and
    gpt-4o-mini, with gpt-6-luna as the replacement. If your n8n offers an older default, pick a model in each node.
  • File types: only PDFs and plain text files are meant to pass. Another type, such as a Word file, matches no rule of
    Switch, so nothing returns to the loop and the run stops with later files unread.
  • Limits: Get All files sees the first 100 files in the bucket. Get All Files has Return All off, so n8n reads only 50
    rows of files. Past 50 rows, older files look new and are added again. Turn on Return All in that node.
  • Each file goes in once. To read a file again, delete its row in files and its pieces in documents first.
  • The metadata filter keeps the chat to one file. Without it the agent searches every file in documents.
  • Billing: OpenAI bills the embeddings for every piece of every new file, and each question takes an agent call plus a call
    for the knowledge tool.
  • Your data: the text of each file goes to OpenAI and into your Supabase project. Your questions go to OpenAI.
  • The Supabase credential holds a secret key, so use a project meant for this.
Files
NOTICE.md  628 B
README.md  6 KB
workflow.json  19 KB

3 files, 26 KB, downloaded as a zip.

What’s new

  • Version 1 · 2026-11-12

Reviews

No ratings yet

Write a review

No reviews yet.

More from Mindket

See all from Mindket

anaksor-ocr

Sokheng · Kit

Reads Khmer and English text from documents, receipts and photos of signs, using a detector for text lines and a recogniser for each line. Suits developers who…

New

Qwen2.5-7B-Instruct as GGUF files in eight quantization sizes, to chat with locally through llama.cpp. For people who want a capable 7.6B model on their own co…

New

ACE-Step 1.5 XL SFT

ACE-Step · Kit

Generates music from text with a 4B diffusion decoder, 50 steps and guidance control, aiming for higher audio quality than the base. For creators with a GPU of…

New

Similar in Productivity

See all in Productivity

Guizang PPT Skill

op7418 · Skill

Skill that makes single-file HTML slide decks, slide illustrations and platform covers in two visual styles, with a presenter mode for rehearsal. For speakers…

New29.8k

Frontend Slides

zarazhangrui · Skill

Builds HTML presentations from scratch or from a PowerPoint file and shows visual style previews to pick from, for people who want web slides with no CSS or Ja…

New32.3k

IPTV

iptv-org · Kit

Collects publicly available live TV channels from many countries into playlists that any video player with live streaming can open. Made for viewers and for de…

New144k