Skip to main content

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

Workflow preview

Workflow preview
100%
Store Notion's Pages as Vector Documents into Supabase with OpenAI preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Workflow updated on 17/06/2024: Added 'Summarize' node to avoid creating a row for each Notion content block in the Supabase table. Store Notion's Pages as Vector Documents into Supabase This workf...

Best for

  • Document Extraction automation workflows
  • AI RAG automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, @n8n/n8n-nodes-langchain.embeddingsopenai, @n8n/n8n-nodes-langchain.textsplittertokensplitter, n8n-nodes-base.notiontrigger, n8n-nodes-base.notion, n8n-nodes-base.filter, n8n-nodes-base.summarize, @n8n/n8n-nodes-langchain.documentdefaultdataloader

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Dataki.

Original n8n.io source

1.1 Workflow description

Title
Store Notion's Pages as Vector Documents into Supabase with OpenAI
Workflow name
Store Notion's Pages as Vector Documents into Supabase with OpenAI

Workflow updated on 17/06/2024: Added 'Summarize' node to avoid creating a row for each Notion content block in the Supabase table.

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 Langchain 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
  2. Retrieve Page Content:

    • Fetches all block content from the newly added Notion page.
    • Node: Get Blocks Content
  3. Filter Non-Text Content:

    • Excludes blocks of type "image" and "video" to focus on textual content.
    • Node: Filter - Exclude Media Content
  4. Summarize Content:

    • Concatenates the Notion blocks content to create a single text for embedding.
    • Node: Summarize - Concatenate Notion's blocks content
  5. Store in Supabase:

    • Stores the processed documents and their embeddings into a Supabase table with a vector column.
    • Node: Store Documents in Supabase
  6. Generate Embeddings:

    • Utilizes OpenAI's API to generate embeddings for the textual content.
    • Node: Generate Text Embeddings
  7. 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
  8. Split Content into Chunks:

    • Divides the text into smaller chunks for easier processing and embedding generation.
    • Node: Token Splitter

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 2 - Embeddings OpenAI

Type / Role
@n8n/n8n-nodes-langchain.embeddingsOpenAi - embeddingsOpenAi
Config choices
Version 1

Block 3 - Token Splitter

Type / Role
@n8n/n8n-nodes-langchain.textSplitterTokenSplitter - textSplitterTokenSplitter
Config choices
Version 1

Block 4 - Notion - Page Added Trigger

Type / Role
n8n-nodes-base.notionTrigger - notionTrigger
Config choices
Version 1

Block 5 - Notion - Retrieve Page Content

Type / Role
n8n-nodes-base.notion - notion
Config choices
Version 2.2

Block 6 - Filter Non-Text Content

Type / Role
n8n-nodes-base.filter - filter
Config choices
Version 2

Block 7 - Summarize - Concatenate Notion's blocks content

Type / Role
n8n-nodes-base.summarize - summarize
Config choices
Version 1

Block 8 - Create metadata and load content

Type / Role
@n8n/n8n-nodes-langchain.documentDefaultDataLoader - documentDefaultDataLoader
Config choices
Version 1

Block 9 - Supabase Vector Store

Type / Role
@n8n/n8n-nodes-langchain.vectorStoreSupabase - vectorStoreSupabase
Config choices
Version 1

3. Summary Table

Workflow Store Notion's Pages as Vector Documents into Supabase with OpenAI
Complexity intermediate
Nodes 9
Categories Document Extraction, AI RAG
Author Dataki
Published 12 Jun 2024

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/2290/2290.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Store Notion's Pages as Vector Documents into Supabase with OpenAI do?

Workflow updated on 17/06/2024: Added 'Summarize' node to avoid creating a row for each Notion content block in the Supabase table. Store Notion's Pages as Vector Documents into Supabase This workf...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Document Extraction, AI RAG use case.