n8n

How to Sync Notion to Supabase AI Knowledge Base?

Turn new Notion pages into search ready data in Supabase. Ideal for teams that store knowledge in Notion and want fast AI search or chat over their docs without manual copy and paste.

A Notion trigger watches a chosen database every minute. When a page is added, the flow pulls all blocks, removes images and video, and joins the text into one clean field. The text is split into chunks of 256 tokens with 30 overlap to improve search quality. The flow adds metadata like page id and created time, generates embeddings with OpenAI, and inserts the text, vectors, and metadata into a Supabase table with a vector column. This creates a reliable pipeline from Notion to your vector store.

You need a Notion connection to the target database, an OpenAI API key, and a Supabase project with a vector table. Expect faster knowledge access, quicker chatbot setup, and fewer manual steps. Great for company wikis, project docs, and meeting notes that need accurate, up to date retrieval.

What are the key features?

  • Notion Page Added trigger checks a database every minute for new pages
  • Retrieves all page blocks and keeps only text content
  • Filters out image and video blocks to avoid noisy data
  • Concatenates text blocks into a single clean field
  • Splits text into chunks of 256 tokens with 30 overlap
  • Adds metadata such as page id and created time
  • Generates embeddings using OpenAI for vector search
  • Inserts text, vectors, and metadata into a Supabase vector table

What are the benefits?

  • Reduce manual copy and paste from 30 minutes per page to 2 minutes
  • Automate up to 90 percent of indexing work from Notion to Supabase
  • Improve data quality by 95 percent by pulling from one source
  • Handle thousands of pages with token based chunking
  • Connect Notion content, OpenAI embeddings, and Supabase in one flow

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with Notion, OpenAI and Supabase. See the Tools Required section above for links to create accounts with these services.
  3. In Notion, create or choose a database for pages you want to index. Share it with your Notion integration so it has access.
  4. Open the Notion Page Added Trigger node in n8n. In the Credential dropdown, click Create new credential and follow the on screen steps to connect Notion. Select your database and keep the every minute polling.
  5. Open the Notion Retrieve Page Content node. Confirm resource is Block, operation is Get All, return all is true, and block id uses the page url from the trigger expression.
  6. Open the Filter node. Set the rule to exclude blocks where type equals image or video so only text continues.
  7. Open the Summarize node. Set it to concatenate the content field with a newline so you get one clean text field.
  8. Open the Embeddings OpenAI node. In the Credential dropdown, click Create new credential, paste your OpenAI API key from the official site, and save. Leave the default embedding model or choose your preferred one.
  9. Open the Token Splitter node. Set chunk size to 256 and chunk overlap to 30 to balance context and cost.
  10. Open the Create metadata and load content node. Map the concatenated text as input and add metadata fields like pageId and createdTime from the trigger expressions.
  11. Open the Supabase Vector Store node. Click Create new credential, then enter your Supabase URL and service role key. Choose insert mode and set the table name that has a vector column.
  12. In Supabase, confirm your table exists with a vector column as documented. If missing, create it before running the flow.
  13. Test the flow by adding a new page to the chosen Notion database. Check the n8n execution, then verify a new row, vector, and metadata appear in your Supabase table.
  14. If nothing inserts, confirm Notion permissions, the database id selection, the Supabase table name, and that your OpenAI key is active. Adjust chunk size if pages are very long.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

Notion

Sign up

Free plan: $0 per member / mo (Public API included)

OpenAI

Sign up

Pay-as-you-go: GPT-5 at $1.25 per 1M input tokens and $10 per 1M output tokens

Supabase

Sign up

Free: $0 / mo — unlimited API requests; 500 MB database; 5 GB bandwidth; 1 GB storage; 50,000 MAUs.

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.