Run a Telegram knowledge base bot with OpenRouter, OpenAI, Supabase and Redis
Ready for 3.0What this workflow does
This AI workflow has 42 nodes and runs on Telegram events (message, callback query) (plus 1 other trigger). Along the way it connects Telegram, Redis, OpenAI and OpenRouter Chat Model and 5 more.
How it runs
Trigger: On Telegram events (message, callback query) (plus 1 other trigger).
- Normalize Telegram Update (Code): runs custom JavaScript code
- Sync Configuration (Edit Fields (Set)): sets 1 field: googleDriveFolderId
- Route Telegram Event (Switch): routes items into 2 branches
- Search Knowledge Base Files (Google Drive): work with file folder
- Is Authorized Control Callback? (If): checks a condition and branches into true / false
- Get Access Status (Redis): get
- Is Google Document? (If): checks a condition and branches into true / false
- Prepare Access Decision (Code): runs custom JavaScript code
- Reject Unauthorized Callback (Telegram): answer query (callback)
- Parse Access Status (Code): runs custom JavaScript code
…plus 23 more steps. See the full node list below.
Services it uses
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 (19)
- Telegram Trigger
n8n-nodes-base.telegramTrigger - Code
n8n-nodes-base.code - Switch
n8n-nodes-base.switch - If
n8n-nodes-base.if - Redis
n8n-nodes-base.redis - Telegram
n8n-nodes-base.telegram - OpenAI
@n8n/n8n-nodes-langchain.openAi - AI Agent
@n8n/n8n-nodes-langchain.agent - OpenRouter Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenRouter - Redis Chat Memory
@n8n/n8n-nodes-langchain.memoryRedisChat - Supabase Vector Store
@n8n/n8n-nodes-langchain.vectorStoreSupabase - Embeddings OpenAI
@n8n/n8n-nodes-langchain.embeddingsOpenAi - Manual Trigger
n8n-nodes-base.manualTrigger - Edit Fields (Set)
n8n-nodes-base.set - Google Drive
n8n-nodes-base.googleDrive - Loop Over Items (Split in Batches)
n8n-nodes-base.splitInBatches - Google Docs
n8n-nodes-base.googleDocs - Default Data Loader
@n8n/n8n-nodes-langchain.documentDefaultDataLoader - Recursive Character Text Splitter
@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter
From the author
Quick overview This workflow runs a Telegram private knowledge-base bot with admin-approved access, answering text or voice questions using an OpenRouter chat model grounded in a Supabase vector knowledge base, and includes a manual Google Docs (Google Drive)…