Run a Telegram hotel search bot with OpenAI and WinWin MCP
Ready for 3.0What this workflow does
This AI workflow has 41 nodes and runs on Telegram events (message, callback query). Along the way it connects Telegram, OpenAI Chat Model, MCP Client and Postgres Chat Memory.
How it runs
Trigger: On Telegram events (message, callback query).
- Route Update Type (Switch): routes items into 5 branches
- Send Welcome Message (Telegram): uses Telegram
- Send Searching Message (Telegram): uses Telegram
- Send Gallery Type Menu (Telegram): uses Telegram
- Parse Gallery Selection (Edit Fields (Set)): sets 2 fields: photo_type, base_button_id
- Hotel Search Agent (AI Agent): runs an AI agent, with model: OpenAI Model (Agent); 2 tools (WinWin MCP Tools, Photo Validation Tool); memory: Postgres Chat Memory; output parser: Hotel Results Parser
- Get Gallery Photos (Data table): get
- Has Hotel Results? (If): checks a condition and branches into true / false
- Send Hotel Name and Room Type (Telegram): uses Telegram
- Build batches of (Code): runs custom JavaScript code
…plus 25 more steps. See the full node list below.
Services it uses
Other Telegram + OpenAI templates (807) · Other OpenAI + PostgreSQL templates (191) · Other Telegram + PostgreSQL templates (70)
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 (15)
- Switch
n8n-nodes-base.switch - Telegram
n8n-nodes-base.telegram - AI Agent
@n8n/n8n-nodes-langchain.agent - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - MCP Client Tool
@n8n/n8n-nodes-langchain.mcpClientTool - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - If
n8n-nodes-base.if - Edit Fields (Set)
n8n-nodes-base.set - Code
n8n-nodes-base.code - Split Out
n8n-nodes-base.splitOut - Loop Over Items (Split in Batches)
n8n-nodes-base.splitInBatches - Data table
n8n-nodes-base.dataTable - Code Tool
@n8n/n8n-nodes-langchain.toolCode - Telegram Trigger
n8n-nodes-base.telegramTrigger - Postgres Chat Memory
@n8n/n8n-nodes-langchain.memoryPostgresChat
From the author
Quick overview This workflow powers a Telegram hotel demo bot that uses OpenAI and the WinWin MCP to search live hotel offers, send rich offer cards with booking links, and store/retrieve validated hotel and room photo galleries via an n8n Data Table. How it…