FlowKit

n8n template · RAG Assistant Pack

Sync Notion to a vector store with n8n

Your documentation lives in Notion? This workflow indexes it automatically: every night at 2 am, it walks a Notion database, chunks and vectorizes the content, then refreshes the vector store — your RAG chatbot stays in sync with today's truth.

Pipelinesync-notion-base-vectorielle.json · 9 nodes
  1. Toutes les nuits à 2htriggerSchedule (cron)
  2. Pages de la base NotionNotion
  3. Préparer le contenuSet (fields)
  4. BoucleLoop (batches)
  5. Insérer dans la base vectorielleSupabase vector store
  6. Notifier la fin sur SlackSlack

Attached AI sub-nodes

  • Chargeur de texteDocument loader
  • Découpage du texteText splitter
  • Embeddings OpenAIOpenAI embeddings

The problem it solves

The worst flaw of a documentation assistant is answering correctly… from an outdated version. A vector store filled once decays silently as the documentation evolves in Notion.

Scheduling indexing at night makes freshness a property of the system: nobody has to think about it. Page-by-page processing (loop) avoids timeouts on large databases and traces every insertion.

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

    Toutes les nuits à 2h

    Schedule (cron)

    Cron 0 2 * * *: the sync runs during off-hours. Increase the frequency if your documentation changes several times a day.

  2. 02

    Pages de la base Notion

    Notion

    Lists all pages of the target Notion database (databasePage getAll). The Notion integration must have been invited to that database.

  3. 03

    Préparer le contenu

    Set (fields)

    Builds for each page a content field (title and properties) and a source field (page URL) that becomes the chatbot's citation.

  4. 04

    Boucle

    Loop (batches)

    Processes pages one by one: each iteration vectorizes one page, and the 'done' output only fires once the whole database has been walked.

  5. 05

    Insérer dans la base vectorielle

    Supabase vector store

    Insert mode into the documents table shared with the pack's other workflows: Notion and PDFs coexist in the same index.

  6. 06

    Chargeur de texte

    Document loader

    ai_document sub-node in JSON mode: loads the content field and attaches the source metadata for citations.

  7. 07

    Découpage du texte

    Text splitter

    1,000-character chunks, 150 overlap — same settings as PDF ingestion for a homogeneous index.

  8. 08

    Embeddings OpenAI

    OpenAI embeddings

    text-embedding-3-small, identical to the pack's other workflows: one vector space for the whole corpus.

  9. 09

    Notifier la fin sur Slack

    Slack

    'Done' branch of the loop: a message confirms the full sync — a missing message one morning is your alert that something broke.

What you need to run it

  • n8n ≥ 1.60 with the LangChain nodes
  • A Notion integration invited to the database to sync
  • A Supabase pgvector project (documents table + match_documents, SQL in the guide)
  • An OpenAI API key and a Slack bot for the notification

Customization ideas

  • Purge then re-index only modified pages by filtering on Notion's last_edited_time
  • Fetch full page bodies (blocks) with an extra Notion node if your content exceeds properties
  • Sync several Notion databases by duplicating the source node and merging the items

FAQ

Frequently asked questions

How do I import this template into n8n?

Import sync-notion-base-vectorielle.json via 'Import from File', create the Notion credential (internal integration token), set your database ID in the Notion node, attach Supabase, OpenAI and Slack, then activate.

Do pages deleted from Notion disappear from the index?

Not automatically in the version provided: insertion is additive. The guide offers a variant that purges a source's chunks before re-indexing — recommended if your content changes often.

How long does a sync take?

Expect one to two seconds per page (embeddings call included). A 200-page database syncs in about 5 minutes, at night, without touching your daytime executions.