# Generate and deploy Notion chat assistants with OpenAI: n8n workflow

> Started by someone opening a chat with it, and works across Notion. It hands the judgement calls to OpenAI.

Source: https://millionrounds.com/workflow/generate-and-deploy-notion-chat-assistants-with-openai (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [Data collection](https://millionrounds.com/workflows?category=Data+collection#library)

# Generate and deploy Notion chat assistants with OpenAI

Started by someone opening a chat with it, and works across Notion. It hands the judgement calls to OpenAI. 24 steps, 2 branches: large, and worth reading before you trust it with anything live.

Large Calls a model: OpenAI

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fgenerate-and-deploy-notion-chat-assistants-with-openai)

**24 steps** Large: read it before trusting it with anything live

**2** Branches: places the flow splits

**0** Loops or waits

**1** Service it connects to

## The flow

Starts it 1 Model 6 Logic 15 Service 2

The steps in the order they run, from what starts it.

- 1 **Chat: Request Notion Database URL** Chat trigger *Starts it*
- 2 **OpenAI Model (Generator)** Lm Chat Open Ai *Model*
- 3 **OpenAI Model (Fixer / Classifier)** Lm Chat Open Ai *Model*
- 4 **OpenAI Model (Fixer / Classifier) copy** Lm Chat Open Ai *Model*
- 5 **Configuration** Set *Logic*
- 6 **Generate Assistant Workflow** Agent *Model*
- 7 **Structured Output Parser** Output Parser Structured *Model*
- 8 **Valid n8n Workflow JSON?** Text Classifier *Model*
- 9 **Get Notion Database Schema** Notion *Service*
- 10 **Extract Generated Workflow** Set *Logic*
- 11 **Build Deployment Payload** Code *Logic*
- 12 **Merge Failed Attempts** Merge *Logic*
- 13 **Standardize Database Schema** Set *Logic*
- 14 **Reply: Invalid Notion URL** Set *Logic*
- 15 **Check for Placeholder Bug** Switch *Logic*
- 16 **Deploy Workflow via n8n API** Http Request *Service*
- 17 **Retry Limit Reached?** If *Logic*
- 18 **Simplify Schema Properties** Code *Logic*
- 19 **Reply: Deployment Success** Set *Logic*
- 20 **Reply: Deploy Failed (Fallback JSON)** Set *Logic*
- 21 **Reply: Generation Failed** Set *Logic*
- 22 **Add Feedback Prompt** Set *Logic*
- 23 **Prepare Agent Input** Code *Logic*
- 24 **Prepare Retry** Set *Logic*

## How it's built

- **Starts on:** Someone opening a chat with it
- **Steps:** 24, with 2 branches
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Notion
- **Model:** OpenAI

## Questions

What does it need to run?

An n8n account, plus your own Notion account, and a key for OpenAI. You connect your own accounts after importing it; none are included.

What starts it?

It starts on someone opening a chat with it.

Does it use AI?

Yes. It calls OpenAI. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Take your time. At 24 steps it is large: read it before trusting it with anything live.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

**Before you run it**

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 24 steps before you point it at anything that matters.

## Run it in n8n

- **Create your n8n account** Free to start. n8n is where the workflow runs. [Create an n8n account ↗](https://millionrounds.com/n8n)
- **Download the workflow** Free with a Millionrounds account. [Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fgenerate-and-deploy-notion-chat-assistants-with-openai)
- **Paste it into n8n** Open a new workflow in n8n and paste. Then connect your own accounts.

Stored with the author's traces removed: canvas notes, instance identifiers, saved credential names and any live document they had left behind.

## Connects to

Each opens the other workflows that use it.

[Notion](https://millionrounds.com/workflows?service=Notion#library)

## Workflows like it

Also data collection, with the same services where possible, closest in size first.

- [**Time tracking with Notion** 24 steps · Notion](https://millionrounds.com/workflow/time-tracking-with-notion)
- [**Build AI-ready knowledge base from Outlook & Notion** 25 steps · calls a model · Notion, Outlook](https://millionrounds.com/workflow/build-ai-ready-knowledge-base-from-outlook-and-notion)
- [**Gemini-powered Facebook comment & DM assistant with Notion** 23 steps · calls a model · Notion](https://millionrounds.com/workflow/gemini-powered-facebook-comment-and-dm-assistant-with-notion)
- [**Score job applications and write AI feedback with OpenAI** 23 steps · calls a model · Notion](https://millionrounds.com/workflow/score-job-applications-and-write-ai-feedback-with-openai)
- [**Sync Notion knowledge base with Vapi and Pinecone** 25 steps · calls a model · Notion, Pinecone](https://millionrounds.com/workflow/sync-notion-knowledge-base-with-vapi-and-pinecone)
- [**Create a new team for a project in Notion** 23 steps · Notion](https://millionrounds.com/workflow/create-a-new-team-for-a-project-in-notion)
