FlowKit

n8n template · RAG Assistant Pack

Ingest PDFs into Supabase pgvector with n8n

First link of a RAG pipeline: this workflow exposes a webhook that accepts your PDFs, extracts the text, splits it into chunks, computes embeddings and inserts everything into a Supabase pgvector table. One curl command indexes a document.

By Clément Lacaille (Tech-Bharat) · updated 11 July 2026 · how we build and test

RAG Assistant Pack — €119

This workflow + 3 more, validated JSON, setup guide, 14-day guarantee

See the pack
Canvas generated from the delivered JSON exportworkflows/ingestion-pdf-supabase-pgvector.json · 6 nodes · n8n
Dépôt de PDF (Webhook) — n8n-nodes-base.webhook v2Dépôt de PDF (Webho…WebhookInsérer dans la base vectorielle — @n8n/n8n-nodes-langchain.vectorStoreSupabase v1.1Insérer dans la bas…Supabase vector storeConfirmer l'ingestion — n8n-nodes-base.respondToWebhook v1.1Confirmer l'ingesti…Webhook responseChargeur de PDF — @n8n/n8n-nodes-langchain.documentDefaultDataLoader v1Chargeur de PDFDocument loaderDécoupage du texte — @n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter v1Découpage du texteText splitterEmbeddings OpenAI — @n8n/n8n-nodes-langchain.embeddingsOpenAi v1.2Embeddings OpenAIOpenAI embeddings
data flow AI sub-node3 explanatory sticky notes in the canvas (not drawn)
workflows/ingestion-pdf-supabase-pgvector.json5.8 KB · 6 nodes
{
  "name": "FlowKit — Ingestion de PDF dans Supabase pgvector",
  "nodes": [
    {"name": "Dépôt de PDF (Webhook)", "type": "n8n-nodes-base.webhook", "typeVersion": 2, "position": [-220,0]},
    {"name": "Insérer dans la base vectorielle", "type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase", "typeVersion": 1.1, "position": [0,0]},
    {"name": "Confirmer l'ingestion", "type": "n8n-nodes-base.respondToWebhook", "typeVersion": 1.1, "position": [220,0]},
    {"name": "Chargeur de PDF", "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader", "typeVersion": 1, "position": [-80,200]},
    {"name": "Découpage du texte", "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter", "typeVersion": 1, "position": [-80,400]},
    {"name": "Embeddings OpenAI", "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi", "typeVersion": 1.2, "position": [140,200]}
  ]
}

Real excerpt of the delivered file (structure only: node parameters and prompts are part of the paid pack).

The problem it solves

A documentation chatbot is only as good as its index: without a reliable ingestion pipeline, the vector store gets filled by hand, badly, then not at all. Ingestion is the unglamorous part of RAG — extraction, chunking, vectorization, metadata — and exactly the part worth standardizing.

By exposing it as a simple HTTP endpoint, this template makes indexing trivial: from a terminal, an internal form or another workflow, anything that can upload a file can feed your assistant.

How the workflow works, node by node

Node names are in French, exactly as they appear in the imported workflow — the logic is language-agnostic.

  1. 01

    Dépôt de PDF (Webhook)

    Webhook

    Receives the PDF as multipart (curl -F) on the flowkit-ingest path. The file arrives as binary data, ready for extraction.

  2. 02

    Insérer dans la base vectorielle

    Supabase vector store

    Root node in insert mode targeting the documents table: it orchestrates loading, chunking and embeddings from its three sub-nodes, then writes chunks, metadata and vectors to Supabase.

  3. 03

    Chargeur de PDF

    Document loader

    ai_document sub-node: extracts text from the PDF binary page by page — no prior conversion needed.

  4. 04

    Découpage du texte

    Text splitter

    ai_textSplitter sub-node: 1,000-character chunks with 150 overlap, the best precision/recall trade-off for business documents.

  5. 05

    Embeddings OpenAI

    OpenAI embeddings

    ai_embedding sub-node: text-embedding-3-small (1,536 dimensions), matching the table's vector(1536) column — dimensions must match on both sides.

  6. 06

    Confirmer l'ingestion

    Webhook response

    Returns a JSON confirmation to the caller once indexing completes: easy to integrate in a bulk-load script.

What you need to run it

  • n8n ≥ 1.60 with the LangChain nodes
  • A Supabase project with pgvector enabled and the match_documents function (full SQL in the pack guide)
  • An OpenAI API key (embeddings)
  • Text-based PDFs (for scans, add an OCR step upstream)

Customization ideas

  • Add metadata (client, version, confidentiality) to the loader to filter searches later
  • Tune chunkSize and chunkOverlap to your documents: shorter for FAQs, longer for contracts
  • Chain ingestion from Google Drive: a Drive trigger replaces the webhook, the rest stays put

FAQ

Frequently asked questions

How do I import this template into n8n?

Import ingestion-pdf-supabase-pgvector.json via 'Import from File', attach your Supabase and OpenAI credentials, run the pgvector SQL from the guide, activate, then test: curl -F 'file=@document.pdf' https://your-n8n/webhook/flowkit-ingest.

What PDF size can the workflow handle?

Reports of several hundred pages go through fine; the limit mostly comes from your reverse proxy's max request body (often 100 MB by default on self-hosted n8n). For whole corpora, call the webhook in a loop, one file at a time.

Can I re-ingest an updated document?

Yes, but delete its old chunks first (delete from documents where metadata->>'source' = '…'), otherwise both versions will coexist in search results.