Generate and deploy Notion chat assistants with OpenAI and n8n API
Ready for 3.0What this workflow does
This AI workflow has 24 nodes and runs when a chat message arrives. Along the way it connects Notion and OpenAI Chat Model.
How it runs
Trigger: When a chat message arrives.
- Configuration (Edit Fields (Set)): sets 6 fields: notion_database_input, openai_model, fixer_model…
- Get Notion Database Schema (Notion): work with database
- Standardize Database Schema (Edit Fields (Set)): sets 5 fields: inputDatabase.id, inputDatabase.url, inputDatabase.public_url…
- Reply: Invalid Notion URL (Edit Fields (Set)): sets 1 field: output
- Simplify Schema Properties (Code): runs custom JavaScript code
- Prepare Agent Input (Code): runs custom JavaScript code
- Generate Assistant Workflow (AI Agent): runs an AI agent, with model: OpenAI Model (Generator); output parser: Structured Output Parser
- Extract Generated Workflow (Edit Fields (Set)): sets 4 fields: generatedWorkflow, searchNotionDBJsonBody, inputDatabase…
- Check for Placeholder Bug (Switch): routes items into 1 branches
- Merge: merges the data from its input branches
…plus 9 more steps. See the full node list below.
Services it uses
Other OpenAI + Notion templates (157)
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
- Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Nodes used (12)
- Chat Trigger
@n8n/n8n-nodes-langchain.chatTrigger - Edit Fields (Set)
n8n-nodes-base.set - Notion
n8n-nodes-base.notion - Code
n8n-nodes-base.code - AI Agent
@n8n/n8n-nodes-langchain.agent - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - Switch
n8n-nodes-base.switch - Merge
n8n-nodes-base.merge - Text Classifier
@n8n/n8n-nodes-langchain.textClassifier - HTTP Request
n8n-nodes-base.httpRequest - If
n8n-nodes-base.if
From the author
Quick overview This workflow takes a Notion database URL via n8n Chat, uses Notion and OpenAI to generate a tailored Notion-search chat assistant workflow, validates the generated n8n JSON, and then deploys the new workflow to your n8n instance via the n8n…