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.
- Toutes les nuits à 2htriggerSchedule (cron)
- Pages de la base NotionNotion
- Préparer le contenuSet (fields)
- BoucleLoop (batches)
- Insérer dans la base vectorielleSupabase vector store
- Notifier la fin sur SlackSlack
Attached AI sub-nodes
- Chargeur de texteDocument loader
- Découpage du texteText splitter
- Embeddings OpenAIOpenAI embeddings
$ n8n import:workflow --input=sync-notion-base-vectorielle.json ✔ Import successful — 9 nodes, valid connections
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.
- 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.
- 02
Pages de la base Notion
NotionLists all pages of the target Notion database (databasePage getAll). The Notion integration must have been invited to that database.
- 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.
- 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.
- 05
Insérer dans la base vectorielle
Supabase vector storeInsert mode into the documents table shared with the pack's other workflows: Notion and PDFs coexist in the same index.
- 06
Chargeur de texte
Document loaderai_document sub-node in JSON mode: loads the content field and attaches the source metadata for citations.
- 07
Découpage du texte
Text splitter1,000-character chunks, 150 overlap — same settings as PDF ingestion for a homogeneous index.
- 08
Embeddings OpenAI
OpenAI embeddingstext-embedding-3-small, identical to the pack's other workflows: one vector space for the whole corpus.
- 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.