AI prompt hub (Notion + ChatGPT): auto-find the right prompt with embeddings
Ready for 3.0What this workflow does
This AI workflow has 18 nodes and runs on Notion events (plus 4 other triggers). Along the way it connects OpenAI Chat Model and Notion. It also calls router.huggingface.co over HTTP.
How it runs
Trigger: On Notion events (plus 4 other triggers).
- Generate Checksum (Code): runs custom JavaScript code
- Get All Prompts (Notion): get many (database page)
- Get Question Embeddings (HTTP Request): calls router.huggingface.co (POST)
- AI Agent: runs an AI agent, with model: OpenAI Chat Model; 1 tool (Search a Prompt); memory: Simple Memory
- If: checks a condition and branches into true / false
- Get All Prompts for search (Notion): get many (database page)
- Get Embeddings (HTTP Request): calls router.huggingface.co (POST)
- Find a prompt (Code): runs custom JavaScript code
- Prepare Update Body (Code): runs custom JavaScript code
- Save Embeddings + Checksum (HTTP Request): calls an HTTP API (PATCH)
Services it uses
HTTP calls to: router.huggingface.co
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.
Nodes used (12)
- Chat Trigger
@n8n/n8n-nodes-langchain.chatTrigger - AI Agent
@n8n/n8n-nodes-langchain.agent - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Simple Memory
@n8n/n8n-nodes-langchain.memoryBufferWindow - Webhook
n8n-nodes-base.webhook - Notion
n8n-nodes-base.notion - HTTP Request
n8n-nodes-base.httpRequest - Code
n8n-nodes-base.code - Notion Trigger
n8n-nodes-base.notionTrigger - Call n8n Workflow Tool
@n8n/n8n-nodes-langchain.toolWorkflow - If
n8n-nodes-base.if - Execute Workflow Trigger
n8n-nodes-base.executeWorkflowTrigger
From the author
Overview Build your own AI Prompt Hub inside n8n. This template lets ChatGPT automatically search your saved prompts in Notion using semantic embeddings from HuggingFace. Each time a user sends a message, the workflow finds the most relevant prompt based on…