Automated Notion Page Sync to Supabase Vector Store using OpenAI - n8n Workflow

This robust n8n workflow automatically syncs new Notion pages to a Supabase vector database, leveraging the OpenAI n8n node to create text embeddings for powerful Retrieval Augmented Generation (RAG) applications.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Knowledge managers and developers building internal RAG systems.
Users looking for advanced examples of integrating n8n with vector databases.
Teams needing to synchronize proprietary documentation from Notion into an AI-ready vector format.
Automation specialists seeking complex n8n templates utilizing LangChain nodes.

Overview

Managing vast knowledge bases often requires integrating data from disparate sources into a unified, queryable format suitable for AI applications like Retrieval Augmented Generation (RAG). This powerful n8n workflow solves the problem of manual data migration and indexing by creating a seamless synchronization pipeline between Notion and Supabase.

By leveraging a specialized n8n trigger, any new page added to a monitored Notion database is automatically processed. The content is cleaned, chunked, and transformed into high-quality vector embeddings using the OpenAI n8n node. These vectors are then stored in your Supabase database's vector column. This sophisticated n8n template ensures your knowledge base is always up-to-date and ready for rapid semantic search queries, drastically improving the performance of your AI applications.

How it Works

This automated n8n workflow operates entirely in the background, initiated by a simple event:


  1. Triggering the Automation: The n8n trigger, specifically the 'Notion - Page Added Trigger' n8n node, constantly monitors a designated Notion database. When a new page is added, the n8n workflow starts.

  2. Content Retrieval: The subsequent n8n node, 'Notion - Retrieve Page Content', fetches all the underlying blocks (text, images, video) that make up the new page.

  3. Data Filtering: To ensure only relevant textual data is processed for embedding, the 'Filter Non-Text Content' n8n node filters out media types like 'image' and 'video'.

  4. Text Preparation: The remaining text blocks are consolidated using the 'Summarize - Concatenate Notion's blocks content' n8n node into a single, cohesive text body.

  5. Document Structuring and Metadata: The text is passed to the 'Create metadata and load content' n8n node. This essential step wraps the plain text into a document object format required by LangChain, simultaneously adding vital metadata extracted from the initial n8n trigger event (page ID, created time, page title).

  6. Chunking: Although the direct connection is complex, the flow is designed to use the 'Token Splitter' n8n node. This component ensures the large document is divided into smaller, manageable chunks (configured for 256 tokens with 30 overlap), optimizing the embedding process and semantic search performance.

  7. Embedding Generation: The resulting document chunks are sent to the 'Embeddings OpenAI' n8n node, which calls the OpenAI API to generate dense vector representations of the text.

  8. Vector Storage: Finally, the vector embeddings and their corresponding document chunks are injected into your Supabase database via the 'Supabase Vector Store' n8n node, completing the storage process initiated by the original n8n trigger.

Installation Guide

To deploy this powerful n8n workflow template, follow these steps:


  1. Import: Copy the provided JSON and import it into your n8n instance.

  2. Credentials Setup:

Notion: You will need a Notion credential configured to access the database specified in the 'Notion - Page Added Trigger' n8n node.
OpenAI: Set up an OpenAI credential for the 'Embeddings OpenAI' n8n node to handle embedding generation.
Supabase: Configure a Supabase credential. This credential requires the necessary API key and service URL.

  1. Node Configuration:

Notion Trigger: In the 'Notion - Page Added Trigger' n8n trigger, select the specific Notion database you wish to monitor.
* Supabase Vector Store: In the 'Supabase Vector Store' n8n node, select the correct database connection and specify the target table name that contains your vector column.

  1. Activation: Once credentials and configurations are complete, activate the n8n workflow to begin automated monitoring.

Node Details

This n8n workflow relies heavily on specialized LangChain and core n8n node types:

Notion - Page Added Trigger (n8n trigger):
Function: Starts the n8n workflow upon detecting a new entry (page) in the designated Notion database.
Key Configuration: Monitors the specified databaseId for changes.

Filter Non-Text Content (n8n node):
Function: Pruning step to ensure data quality. It excludes blocks of content where the type is 'image' or 'video'.
Key Configuration: Uses two notEquals conditions targeting the type property.

Summarize - Concatenate Notion's blocks content (n8n node):
Function: Aggregates the individual Notion content blocks into one large text string (concatenatedcontent) suitable for document loading and embedding.
Key Configuration: Aggregation: Concatenate; Separate By: newline character (\n).

Create metadata and load content (LangChain Document Default Data Loader):
Function: Converts the raw concatenated text into a structured document object, attaching crucial metadata (e.g., pageId, pageTitle) pulled from the initiating n8n trigger data.
Key Configuration: Data source expression points to concatenated
content.

Token Splitter (LangChain Text Splitter):
Function: Splits large documents into smaller, optimized chunks for embedding. This is critical for RAG efficiency.
Key Configuration: Chunk Size: 256; Chunk Overlap:
30.

Embeddings OpenAI (LangChain Embeddings n8n node):
Function: Generates the high-dimensional vector representations of the text chunks using the OpenAI API.
Key Configuration: Requires a valid OpenAI credential.

Supabase Vector Store (LangChain Vector Store n8n node):
Function: Handles the final insertion of the document chunks and their corresponding vectors into the target Supabase table.
* Key Configuration: Mode: Insert; requires selection of the target tableName and a Supabase credential.

Related n8n Workflows

Free

Nodes: 9 Nodes
Updated: December 26 2025
View all
Created by

I am passionate about transforming complex processes into seamless automations with n8n. My expertise spans across creating ETL pipelines, sales automations, and data & AI-driven workflows. As an avid problem solver, I thrive on optimizing workflows to drive efficiency and innovation.

Featured*