Automate Storing Notion Pages as Vectors in Supabase with OpenAI

Save hours by automatically converting new Notion pages into vector documents stored in Supabase using OpenAI embeddings. This workflow removes manual copy-pasting and ensures searchable, well-organized data in your database with minimal effort.
notionTrigger
embeddingsOpenAi
vectorStoreSupabase
+6
Workflow Identifier: 1734
NODES in Use: Sticky Note, Embeddings OpenAI, Token Splitter, Notion Trigger, Notion, Filter, Summarize, Document Default Data Loader, Supabase Vector Store
Automate Notion pages with n8n and OpenAI

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

What This Automation Does

This workflow watches for new pages in a Notion database and turns the page text into searchable vectors using OpenAI embeddings.
It works automatically so the user does not have to copy-paste or clean content manually.
The final vectors get stored in a Supabase table for easy AI use like smart search or recommendations.
This saves many hours and reduces mistakes from manual work.

Inputs come from new Notion pages.
The workflow fetches all text blocks, skips images and videos.
Then it joins the text together and splits it into small chunks.
Each chunk is converted into an embedding using OpenAI.
Finally, the embeddings and metadata are saved in Supabase.


Tools and Services Used

  • Notion API: Monitors the database and fetches page content.
  • n8n: Runs the workflow and connects all parts.
  • OpenAI API: Creates text vector embeddings.
  • Supabase Database: Stores vectors with metadata for later AI queries.

Beginner step-by-step: How to Use This Workflow in n8n

Import and Setup

  1. Download the workflow file using the Download button on this page.
  2. Open the n8n editor and click “Import from File” to add the workflow.

Add Credentials and IDs

  1. Go to each node and add required credentials like Notion API Key, OpenAI API Key, and Supabase connection details.
  2. Update the Notion database ID to your own database’s ID.
  3. Check the Supabase table name to match your vector table.

Test and Activate

  1. Run the workflow manually once using a test page added in Notion.
  2. Confirm the output vectors appear in Supabase.
  3. Turn on the workflow toggle to activate for production.
  4. Make sure n8n keeps running to listen for new pages.

This gets the workflow working without building from scratch.
For production, consider using self-host n8n for better control and reliability.


Inputs, Processing Steps, and Output

Inputs

  • New page added to the Notion database triggers the workflow.
  • The page ID and URL start the content fetching process.

Processing Steps

  • Fetch content blocks: Get all text blocks of the page, exclude images/videos.
  • Filter text blocks: Remove non-text items with conditions on type.
  • Concatenate blocks: Join text into a single string for embedding.
  • Split text: Divide long text into chunks of about 256 tokens with overlap.
  • Metadata creation: Prepare metadata like page ID, creation time, and title.
  • Embedding generation: Send chunks to OpenAI to make vectors.
  • Save to Supabase: Insert embeddings and metadata into a vector column table.

Output

  • Rows in Supabase holding semantic vectors ready for AI-driven search or analysis.
  • Metadata associated so vector documents can be identified.

Customizations ✏️

  • Change how often the Notion Trigger polls for new pages, for example from 1 to 5 minutes.
  • Allow more block types like code or quotes by adjusting the Filter node.
  • Modify the Token Splitter chunk size from 256 to 512 tokens if OpenAI limits allow.
  • Add extra metadata fields such as author or tags from Notion properties in the Document Loader node.

Troubleshooting 🔧

Problem: No new pages detected by Notion Trigger

Cause: The database ID might be wrong or API permissions are missing.
Solution: Double check the database ID and integration permissions in Notion. Reconnect the API if needed.

Problem: Failed to fetch content blocks

Cause: The block ID is not set correctly or ‘Return All’ is off.
Solution: Map blockId dynamically using {{$json.url}} from the trigger node. Enable ‘Return All’.

Problem: OpenAI Embedding API errors or rate limits

Cause: API keys invalid or usage limits exceeded.
Solution: Confirm API key is correct, monitor usage stats, consider upgrading quota. Add retry logic.


Pre-Production Checklist ✅

  • Verify Notion API integration and database ID accuracy.
  • Ensure the Supabase table with a vector column is ready.
  • Test OpenAI key with a simple embedding before starting.
  • Run the complete workflow test with a Notion test page.
  • Confirm the Filter node excludes only images and videos.
  • Make sure metadata fields like page ID and title exist.

Deployment Guide

After testing, activate the workflow inside n8n by switching it on.
Watch n8n execution logs for errors after activation.
Check the Supabase table regularly to see new vectors.
Match OpenAI API quotas with your workflow volume.
For stable production, use self-host n8n.


Summary

✓ The workflow automates converting Notion pages into vector embeddings.
✓ It saves manual time and reduces errors.
✓ Vectors and metadata get stored in Supabase ready for AI use.
✓ Easy to import, configure, and run inside n8n with minimal setup.


Automate Notion pages with n8n and OpenAI

Visit through Desktop to Interact with the Workflow.

Frequently Asked Questions

Download the workflow file and import it in n8n using Import from File. Then add your API keys and update database and table IDs. Test once and activate it.
The main causes are wrong Notion database ID or missing API permissions. Check both to fix detection issues.
It splits long text into chunks of 256 tokens with overlap before sending to OpenAI for embedding, to keep processing manageable.
Yes, but this workflow is built specifically for Supabase vector columns. Other stores require different setup.

Promoted by BULDRR AI

Related Workflows

Automate Twist Channel Creation and Messaging with n8n

This workflow automates creating and updating a channel in Twist and sending a personalized message to specific users. It eliminates manual setup errors and saves time managing Twist communications.

Automate Ideogram Image Generation with Google Sheets & Gmail

This workflow automates graphic design image generation via Ideogram AI, storing image data in Google Sheets and Google Drive, with email alerts via Gmail. It saves designers hours by automating image creation, remixing, review, and record-keeping.

Automate IT Support with Slack and OpenAI in n8n

Streamline IT support by automating Slack message handling using n8n and OpenAI. This workflow handles Slack DMs, filters bots, queries a Confluence knowledge base, and delivers AI-generated responses, improving support efficiency and response time.

Automate Crypto Analysis with CoinMarketCap & n8n AI Agent

Discover how this unique n8n workflow leverages CoinMarketCap’s multi-agent AI to deliver precise, real-time cryptocurrency insights directly via Telegram. Manage crypto data analysis efficiently with automated multi-source API integration.

Automate Gumroad to Beehiiv Subscriber Sync with n8n

Learn how to automatically add new Gumroad sales customers as Beehiiv newsletter subscribers using n8n automation. This workflow saves time by syncing sales data to Google Sheets CRM and notifying your Telegram channel instantly.

Generate On-Brand Blog Articles Using n8n and OpenAI

This workflow automates the creation of on-brand blog articles by analyzing existing company content using n8n and OpenAI. It extracts article structures and brand voice to produce consistent draft articles, saving significant content creation time.
1:1 Free Strategy Session
Your competitors are already automating. Are you still paying for it manually?

Do you want to adopt AI Automation?

Every hour your team does repetitive work, you're burning real money.
While you wait, faster businesses are cutting costs and moving quicker.
AI and automations aren't the future anymore — they're the present.

Book a live 1-on-1 session where we show you exactly which of your daily tasks can be automated — and what it’s costing you not to.