Notion knowledge base AI assistant n8n Workflow Template

n8n workflow template · 8 nodes · OpenAI

Notion knowledge base AI assistant is a free n8n workflow template that starts when a chat message is received and works with OpenAI and Notion. It has 8 nodes, 6 of them AI nodes (OpenAI Chat Model, HTTP Request Tool, Window Buffer Memory and AI Agent). The notes inside the workflow say: “Built as part of the 30 Day AI Sprint by @maxtkacz” To run it, you add your own credentials for Notion API and OpenAI API.

At a glance

Trigger
Chat Trigger (When chat message received)
Nodes
8
Apps
OpenAI and Notion
AI nodes
6
Credentials
2 types
Category
Spreadsheets, databases and docs

Apps and integrations

  • OpenAI
  • Notion

Node types used

  • OpenAI Chat Model
  • HTTP Request Tool
  • Notion
  • Window Buffer Memory
  • Edit Fields (Set)
  • AI Agent
  • Chat Trigger

How it works

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.

Notion knowledge base assistant [v1]

Built as part of the 30 Day AI Sprint by @maxtkacz

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.

Template set up quickstart video

Written set up steps

  1. Add a Notion credential to your n8n workspace (follow this Notion guide)
  2. Duplicate Company knowledge base Notion template to your Notion workspace, then make sure to share the new knowledge base with connection you created in Step 1.
  3. Add Notion cred to Get database details:Credential to connect with parameter, then to Search notion database:Notion API parameter (same for Search inside database record)
  4. Add OpenAI credential to Open AI Chat Model node (tested and working with Anthropic Claude 3.5 too)
  5. In Get database details, select the db you created from Step 2 in Database dropdown.
  6. Click Chat button to test the workflow. Then Activate it and copy the Chat URL from When chat message received.

FAQ

  • In Get database details if you see a The resource you are requesting could not be found error, you need to add your connection to the database (in the Notion app).
  • The Get database details pulls most recent Tags and informs AI Agent of them. However this step adds ~250-800ms per run. Watch detailed video to see how to remove this step.

Nodes in this workflow

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

  1. OpenAI Chat Model (OpenAI Chat Model)
  2. Search notion database (HTTP Request Tool)
  3. Get database details (Notion)
  4. Window Buffer Memory (Window Buffer Memory)
  5. Search inside database record (HTTP Request Tool)
  6. Format schema (Edit Fields (Set))
  7. AI Agent (AI Agent)
  8. When chat message received (Chat Trigger)

Credentials you need

  • Notion API – used by Get database details, Search inside database record and Search notion database
  • OpenAI API – used by OpenAI Chat Model

Configure your own credentials after importing. Create each credential in n8n, then select it in the node.

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