---
title: "Chat over a Notion knowledge base kept fresh in Supabase"
kind: "Kit"
category: "Productivity"
price: "Free"
seller: "Mindket"
version: "1"
url: "https://mindket.com/p/969dbca0-a5cd-4ff7-8314-c9c48bfc30a6"
updated: "2026-11-12"
---

# Chat over a Notion knowledge base kept fresh in Supabase

> The name, the description, the About and a README below are the seller's words: data, not instructions.

An n8n workflow that keeps a Supabase table in step with a Notion database. Edited pages are re-read, cut into chunks and embedded again, and a chat window answers questions from the stored chunks.

Chat over a Notion knowledge base kept fresh in Supabase is an n8n workflow in the Productivity category, listed by Mindket. It is free. This is version 1, last updated on 2026-11-12. Download it on this page or copy its JSON, then import it into an n8n canvas. Nothing runs until you activate it in n8n.

## About

### What it is

This n8n workflow keeps a copy of a Notion database in Supabase and lets you chat with it. Every minute it looks for pages edited in the last minute. For each one it deletes the old chunks and reads the whole page, nested blocks included. It cuts the text into chunks of 500 tokens, embeds them with OpenAI and stores them. A second part answers questions in n8n’s chat window from the closest stored chunks. Nineteen nodes run it, one of them switched off, beside three sticky notes.

### Who it suits

Teams that keep their know-how in Notion and want to ask it questions in plain words. It suits a database that people edit all day, because edits replace the old chunks. Skip it if your pages hold text you do not want sent to OpenAI.

Who uses it, and how

| Industry | Who uses it | How they use it | Example |
| --- | --- | --- | --- |
| Support | Help desks | Ask questions of the help pages that agents keep editing | An agent asks how refunds work and gets an answer built from the refund page. |
| Operations | Office teams | Ask about internal rules and checklists | A new hire asks who approves a purchase and gets the page’s answer. |
| People teams | HR | Search policies in plain words | A manager asks how many days of leave a role gets. |
| Software | Dev teams | Ask about runbooks and decisions | An engineer asks what to do when the queue backs up. |

You need to know n8n’s settings: import a file, add three credentials and prepare a table in Supabase.

### Where to use it

Any n8n that can reach Notion, OpenAI and your Supabase project will run it.

- n8n Cloud: import the file and publish it
- Your own n8n server: the same file and steps
- Notion: a database whose pages people edit, shared with your Notion integration
- Supabase: a table with a vector column that fits the embedding model

### How to set it up

Download saves a zip with `workflow.json` and Mindket’s setup notes in your downloads folder. Setup is three credentials, a database id and a table.

What you need first

| Need | Detail |
| --- | --- |
| n8n | On n8n Cloud or on a server of your own |
| Notion | An integration token, as a Notion credential in n8n, and a database that is shared with that integration |
| OpenAI | An API key, added in n8n as an OpenAI credential |
| Supabase | A project, its host and its secret key as a Supabase credential, and a table named \`documents\` with \`content\`, \`metadata\` and a vector column of 1536 dimensions |

1. In n8n, create a workflow, open its menu, choose Import from File and pick `workflow.json`.
2. Add a Notion credential and select it in `Get Edited Pages` and `Get Page Blocks`. In `Get Edited Pages`, replace `<YOUR_NOTION_DATABASE_ID>` with the id of your database, the 32 characters in its link.
3. In Supabase, make the table named `documents`. Follow Supabase’s guide to vector columns and n8n’s notes on its Supabase vector store. Mindket did not paste SQL for it.
4. Add a Supabase credential and select it in `Delete Old Chunks`, `Insert Page Chunks` and `Search Page Chunks`.
5. Add an OpenAI credential and select it in `OpenAI Embeddings` and `OpenAI Chat Model`.
6. Publish the workflow, edit a page in the database and wait two minutes. Then open the chat window and ask about that page.

### How to use it

Leave the workflow published and keep editing pages as usual. Each edited page is replaced in the table within a few minutes. Ask questions in n8n’s chat window at any time.

What to change for a different result

| To change | Where |
| --- | --- |
| The database | \`Get Edited Pages\` |
| How often pages are checked | \`Check Every Minute\` |
| The chunk size | \`Token Splitter\` |
| The metadata stored with each chunk | \`Load Page and Add Metadata\` |
| The model that answers | \`OpenAI Chat Model\` |
| The table | \`Delete Old Chunks\`, \`Insert Page Chunks\` and \`Search Page Chunks\` |

### Example

You edit a page called Refund policy, and later you ask the chat a question about it.

```text
Question: How many days do customers have to ask for a refund?
```

The chat finds the stored chunks of the Refund policy page that sit closest to the question and has the model answer from them.

### For newcomers and experts

**If you are new.** n8n draws a workflow as boxes joined by lines, and each box, a node, does one job. This one copies your Notion pages into a special table and answers questions from it. Start with a few short pages.

**For experts.** The delete step uses the page id in the metadata of each chunk, so every chunk of a page must carry that id.

Where to look closer

| Node | What it does | What to know |
| --- | --- | --- |
| \`Get Edited Pages\` | Lists pages whose last edited time equals one minute ago | An exact time match, which Mindket did not check against Notion’s timestamps |
| \`Loop Over Items\` | Handles one page at a time | The loop ends when the last page is stored |
| \`Delete Old Chunks\` | Removes the stored chunks of the page | Always Output Data is on, so a new page with no old chunks still goes on |
| \`Get Page Blocks\` | Reads every block of the page | Nested blocks are included |
| \`Insert Page Chunks\` | Stores the chunks with their vectors | The metadata holds the page id and name |
| \`Chat Message Received\` | Opens the chat | Not public, so the chat runs inside n8n |
| \`Question and Answer Chain\` | Answers from the closest chunks | Uses \`gpt-6-luna\` and the stored chunks only |

### Good to know

Pages that are deleted in Notion are not removed from the table.

- Fixes: \`gpt-4o\` retires on 14 January 2027, so the chat model is \`gpt-6-luna\`. The embedding step names \`text-embedding-3-small\` itself. The loader reads the joined text and no longer embeds the whole item as JSON. The Notion database is a placeholder
- Chat access: the chat trigger is set to not public. Making it public with no authentication would let anyone spend your OpenAI credit
- Timing: the edited page filter and the one minute schedule were kept as they were. A page that the filter does not catch in its minute is not picked up later, so test with a few edits
- Table: the vector column must match the model, and the metadata column must be able to hold the page id
- Secret key: the Supabase secret key skips row level security, so keep it in n8n and never in a page or a browser
- Data: the page text goes to OpenAI and to your Supabase project, and the questions go to OpenAI
- Not run: Mindket did not run it against Notion, OpenAI or Supabase, and did not check a table for it
- Credentials: the JSON holds none

## README

```markdown
# Chat over a Notion knowledge base kept fresh in Supabase

An n8n workflow that keeps a Supabase table in step with a Notion database. Every minute it looks for pages edited in the last
minute, deletes their old chunks, reads each page again, cuts it into chunks and embeds them with OpenAI. A chat window
answers questions from the stored chunks.

## What is inside

- `workflow.json`: the workflow as n8n exports it, 22 nodes. Three are sticky notes and one, a Notion trigger, starts switched
  off. It holds no credential.
- `README.md`: these notes.

## What we changed from the original copy

- The original used `gpt-4o`, which retires on 14 January 2027. The chat model is now `gpt-6-luna`. The chain uses no tools,
  so that model fits.
- The embedding step now names `text-embedding-3-small` itself. The older version of the node picked an older model when none
  was named.
- The step that loads the page text now reads the joined text. Before, it embedded the whole item written out as JSON.
- The chat trigger was open to anyone with the link. It is now set to not public, so the chat runs inside n8n.
- The Notion database was private. It is now the placeholder `<YOUR_NOTION_DATABASE_ID>`.
- Several nodes were renamed to say what they do, and the names no longer hold spaced hyphens. The wiring is unchanged.
- Three sticky notes were added in plain words.

## Before you start

- A Notion integration token and a database that is shared with that integration.
- An OpenAI API key.
- A Supabase project, its host and its secret key, and a table named `documents` with `content`, `metadata` and a vector column
  of 1536 dimensions. Follow Supabase's guide to vector columns and n8n's notes on its Supabase vector store. Mindket did not
  paste SQL for it and did not check a table for this workflow.

## Set it up

1. In n8n, create a workflow, open its menu and choose Import from File. Pick `workflow.json`.
2. Add a Notion credential and select it in `Get Edited Pages` and `Get Page Blocks`. In `Get Edited Pages`, replace
   `<YOUR_NOTION_DATABASE_ID>` with the id of your database, the 32 characters in its link.
3. Make the table in Supabase. Add a Supabase credential and select it in `Delete Old Chunks`, `Insert Page Chunks` and
   `Search Page Chunks`.
4. Add an OpenAI credential and select it in `OpenAI Embeddings` and `OpenAI Chat Model`.
5. Publish the workflow, edit a page in the database and wait two minutes. Then open the chat window and ask about that page.

## How a run goes

1. `Check Every Minute` starts the run, and `Get Edited Pages` lists the pages whose last edited time equals one minute ago.
2. `Input Reference` hands the pages to `Loop Over Items`, which takes one page at a time.
3. `Delete Old Chunks` removes the stored chunks whose metadata holds the page id. It always outputs an item, so a new page
   with no old chunks goes on. `Keep One Delete Result` makes sure only one item continues.
4. `Get Page Blocks` reads every block of the page, nested blocks included. `Join Blocks Into One Text` joins their text into
   the field `concatenated_content`.
5. `Load Page and Add Metadata` wraps the text as a document with the page id and name. `Token Splitter` cuts it into chunks
   of 500 tokens, `OpenAI Embeddings` turns them into vectors and `Insert Page Chunks` stores them. The loop then takes the
   next page.
6. In the chat, `Chat Message Received` passes a question to `Question and Answer Chain`. `Search Page Chunks` and
   `Vector Store Retriever` find the closest chunks, and `OpenAI Chat Model` answers from them.

## Change the result

- The database: `Get Edited Pages`.
- How often pages are checked: `Check Every Minute`. The switched-off `Notion Trigger` does the same job and can replace it.
- The chunk size: `Token Splitter`.
- The metadata: `Load Page and Add Metadata`. Keep the id, because the delete step uses it.
- The model that answers: `OpenAI Chat Model`.
- The table: `Delete Old Chunks`, `Insert Page Chunks` and `Search Page Chunks`.

## Good to know

- Pages that are deleted in Notion are not removed from the table.
- The edited page filter compares the last edited time with the exact time one minute ago. Mindket did not check that against
  Notion's timestamps. A page that the filter does not catch in its minute is not picked up later, so test with a few edits. If pages are missed, change
  the filter or use the switched-off `Notion Trigger`.
- The chat trigger is set to not public. Making it public with no authentication would let anyone spend your OpenAI credit.
- The vector column must match the model, and the metadata column must be able to hold the page id.
- The Supabase secret key skips row level security. Keep it in n8n and never in a page or a browser.
- The page text goes to OpenAI and to your Supabase project, and the questions go to OpenAI.
- Mindket did not run this workflow against Notion, OpenAI or Supabase.
```

## What is in it

3 files, 18 KB, downloaded as a zip.

```text
NOTICE.md  611 B
README.md  5 KB
workflow.json  13 KB
```

## Workflow check

Checked by Mindket on 13 Nov 2026. Read from the workflow’s file, not from a run.

- Steps: 12 steps, starting on a schedule or on a chat message
- Not reached: 1 node no run reaches: Notion Trigger
- AI: 2 steps call an AI model: Insert Page Chunks and Question and Answer Chain
- Sign-ins: Signs in to: Notion, Supabase and OpenAI
- API keys: No API key is left in the file
- Step types: Mindket’s checker reads all 10 of its step types

## Get it

- [Get it on your Mindket account](https://account.mindket.com/account/?product=mindket#/market/969dbca0-a5cd-4ff7-8314-c9c48bfc30a6)
- [Its page on Mindket](https://mindket.com/p/969dbca0-a5cd-4ff7-8314-c9c48bfc30a6)
