Answer support questions from your docs with Telegram, OpenRouter and pgvector
Ready for 3.0What this workflow does
This AI workflow has 28 nodes and runs on Telegram events (message). Along the way it connects Telegram, Postgres PGVector Store, Embeddings OpenAI and Postgres and 2 more.
How it runs
Trigger: On Telegram events (message).
- Agent Settings (Edit Fields (Set)): sets 6 fields: businessName, supportChatId, minSimilarity…
- Search Knowledge Base (Postgres PGVector Store): searches the Postgres PGVector Store vector store, with embeddings: Embeddings for Search
- Score Retrieval Confidence (Code): runs custom JavaScript code
- Prepare Agent Error (Edit Fields (Set)): sets 4 fields: workflow, node, message…
- Is Retrieval Confident Enough? (If): checks a condition and branches into true / false
- Log Error in Postgres (Postgres): run a query
- Answer From Your Docs (AI Agent): runs an AI agent, with model: OpenRouter Chat Model; 1 tool (Knowledge Base Search Tool); memory: Remember This Chat in Postgres
- Tell Customer a Human Will Reply (Telegram): uses Telegram
- Alert Support Team About Error (Telegram): uses Telegram
- Check Agent Certainty (Code): runs custom JavaScript code
…plus 10 more steps. See the full node list below.
Services it uses
Other Telegram + OpenAI templates (807) · Other OpenAI + PostgreSQL templates (191) · Other Telegram + OpenRouter templates (136)
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)
- Telegram Trigger
n8n-nodes-base.telegramTrigger - Edit Fields (Set)
n8n-nodes-base.set - Postgres PGVector Store
@n8n/n8n-nodes-langchain.vectorStorePGVector - Embeddings OpenAI
@n8n/n8n-nodes-langchain.embeddingsOpenAi - Postgres
n8n-nodes-base.postgres - Telegram
n8n-nodes-base.telegram - Code
n8n-nodes-base.code - If
n8n-nodes-base.if - AI Agent
@n8n/n8n-nodes-langchain.agent - OpenRouter Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenRouter - Postgres Chat Memory
@n8n/n8n-nodes-langchain.memoryPostgresChat - Default Data Loader
@n8n/n8n-nodes-langchain.documentDefaultDataLoader
From the author
Quick overview This workflow turns a Telegram bot into an AI support agent that answers from your Postgres pgvector knowledge base using OpenRouter, and hands off to a human support chat when retrieval or the agent is not confident, while logging Q&A and…