Store Notion's Pages as Vector Documents into Supabase with OpenAI n8n Workflow Template

n8n workflow template · 8 nodes · OpenAI

Store Notion's Pages as Vector Documents into Supabase with OpenAI is a free n8n workflow template that starts from the Notion Trigger node and works with OpenAI, Notion and Supabase. It has 8 nodes, 4 of them AI nodes (OpenAI Embeddings, Token Splitter, Default Data Loader and Supabase Vector Store). The notes inside the workflow say: “This workflow assumes you have a Supabase project with a table that has a vector column. If you don't have it, follow the instructions here: Supabase Vector Columns Guide”

At a glance

Trigger
Notion Trigger (Notion - Page Added Trigger)
Nodes
8
Apps
OpenAI, Notion and Supabase
AI nodes
4
Credentials
None
Category
RAG, documents and vector search

Apps and integrations

  • OpenAI
  • Notion
  • Supabase

Node types used

  • OpenAI Embeddings
  • Token Splitter
  • Notion Trigger
  • Notion
  • Filter
  • Summarize
  • Default Data Loader
  • Supabase Vector Store

Setup notes

The text below comes from the sticky notes inside the workflow. We removed links, code samples and anything that looks like a key or token.

Store Notion's Pages as Vector Documents into Supabase

This workflow assumes you have a Supabase project with a table that has a vector column. If you don't have it, follow the instructions here: Supabase Vector Columns Guide

Workflow Description

This workflow automates the process of storing Notion pages as vector documents in a Supabase database with a vector column. The steps are as follows

  1. Notion Page Added Trigger
  • Monitors a specified Notion database for newly added pages. You can create a specific Notion database where you copy the pages you want to store in Supabase.
  • Node: Page Added in Notion Database
  1. Retrieve Page Content
  • Fetches all block content from the newly added Notion page.
  • Node: Get Blocks Content
  1. Filter Non-Text Content
  • Excludes blocks of type "image" and "video" to focus on textual content.
  • Node: Filter - Exclude Media Content
  1. Summarize Content
  • Concatenates the Notion blocks content to create a single text for embedding.
  • Node: Summarize - Concatenate Notion's blocks content
  1. Store in Supabase
  • Stores the processed documents and their embeddings into a Supabase table with a vector column.
  • Node: Store Documents in Supabase
  1. Generate Embeddings
  • Utilizes OpenAI's API to generate embeddings for the textual content.
  • Node: Generate Text Embeddings
  1. Create Metadata and Load Content
  • Loads the block content and creates associated metadata, such as page ID and block ID.
  • Node: Load Block Content & Create Metadata
  1. Split Content into Chunks
  • Divides the text into smaller chunks for easier processing and embedding generation.
  • Node: Token Splitter

Nodes in this workflow

The 8 nodes in file order (sticky notes excluded). Branches and connections determine execution order in n8n:

  1. Embeddings OpenAI (OpenAI Embeddings)
  2. Token Splitter (Token Splitter)
  3. Notion - Page Added Trigger (Notion Trigger)
  4. Notion - Retrieve Page Content (Notion)
  5. Filter Non-Text Content (Filter)
  6. Summarize - Concatenate Notion's blocks content (Summarize)
  7. Create metadata and load content (Default Data Loader)
  8. Supabase Vector Store (Supabase Vector Store)

Credentials you need

The workflow JSON lists no credentials. Nodes that call external services may still need credentials after you import it.

How to import into n8n

  1. Download the JSON file with the button above.
  2. In n8n, open a new workflow, select the ... menu and choose Import from File. You can also paste the JSON straight into the editor canvas.
  3. Open each node that shows a warning and select or create its credential.
  4. Read the notes on the canvas, test the workflow with sample data, then activate it.

Do you need somewhere to run it? Read our guide to self-hosted n8n.

Need this customised?

We can adapt this workflow to your apps, data and process, then deploy and support it.

Contact Us