Chat with OpenAIs GPT via a simple Telegram Bot
Create an interactive Telegram bot that converses with users using OpenAI's powerful GPT models. This workflow connects a Telegram Trigger node to an AI Agent, which then utilizes the OpenAI Chat Model to generate responses before sending them back to the user via a Telegram node. Businesses can deploy this for instant customer support, content creators can offer engaging Q&A sessions, and individuals can build personalized AI companions, solving the problem of needing a quick, accessible, and intelligent conversational interface without complex coding. This automation saves significant development time and resources by providing a ready-to-use framework for integrating advanced AI into a popular messaging platform.
Workflow JSON
{"meta": {"instanceId": "014363851c6b81282e1489df62d7f66bb7c99af5dcb6c1032b3a83a1d72baee4"}, "nodes": [{"id": "0b4eb8e4-e98b-4f67-b134-914a5aa46b4d", "name": "Telegram Trigger", "type": "n8n-nodes-base.telegramTrigger", "position": [960, 400], "webhookId": "9c8b833c-7aa7-430d-8fc0-47936f695ddf", "parameters": {"updates": ["message"], "additionalFields": {}}, "credentials": {"telegramApi": {"id": "", "name": "[Your telegramApi]"}}, "typeVersion": 1.1}, {"id": "339246f2-76cb-44c4-8828-da0cb5d3ad5e", "name": "OpenAI Chat Model", "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi", "position": [1100, 600], "parameters": {"options": {}}, "credentials": {"openAiApi": {"id": "", "name": "[Your openAiApi]"}}, "typeVersion": 1}, {"id": "70a981e2-7833-473b-a27a-fedf860901cb", "name": "AI Agent", "type": "@n8n/n8n-nodes-langchain.agent", "position": [1200, 400], "parameters": {"text": "=Respond to this as a helpful assistant with emojis: {{ $json.message.text }}", "options": {}}, "typeVersion": 1.2}, {"id": "fb6ff65b-56b4-44c4-978a-b9a5c3d535d6", "name": "Telegram", "type": "n8n-nodes-base.telegram", "position": [1560, 400], "parameters": {"text": "={{ $json.output }}", "chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}", "additionalFields": {"appendAttribution": false}}, "credentials": {"telegramApi": {"id": "", "name": "[Your telegramApi]"}}, "typeVersion": 1.1}], "pinData": {}, "connections": {"AI Agent": {"main": [[{"node": "Telegram", "type": "main", "index": 0}]]}, "Telegram Trigger": {"main": [[{"node": "AI Agent", "type": "main", "index": 0}]]}, "OpenAI Chat Model": {"ai_languageModel": [[{"node": "AI Agent", "type": "ai_languageModel", "index": 0}]]}}}How to Import This Workflow
- 1Copy the workflow JSON above using the Copy Workflow JSON button.
- 2Open your n8n instance and go to Workflows.
- 3Click Import from JSON and paste the copied workflow.
Don't have an n8n instance? Start your free trial at n8nautomation.cloud
Related Templates
Telegram AI multi-format chatbot
Automate a multi-format AI chatbot on Telegram, allowing users to interact via text or voice. This workflow connects Telegram for user input and replies with OpenAI for AI processing and voice-to-text conversion. It's ideal for customer support, content generation, or interactive learning platforms. This saves significant time and effort in managing diverse user interactions.
Post New YouTube Videos to X
Automatically share your latest YouTube video content on X (formerly Twitter) with this powerful n8n workflow. This automation regularly checks your YouTube channel for new uploads, then leverages OpenAI's ChatGPT to craft engaging X posts, and finally publishes them directly to your X account. Content creators, businesses, and marketers can use this to maintain a consistent social media presence, ensuring their audience on X is immediately notified of new video releases without manual intervention. This workflow eliminates the need to constantly monitor your YouTube channel and manually compose social media updates, saving significant time and effort while boosting content visibility and audience engagement.
Discord AI bot
Automate the intelligent routing of incoming user requests from a webhook to the appropriate Discord department with this powerful workflow. This n8n workflow leverages OpenAI's advanced natural language processing to analyze user input, then directs the request to either the User Success Dept, IT Dept, or Helpdesk Discord channel based on the identified category. Imagine a customer submitting a query through a web form; this workflow instantly understands their need and posts it in the relevant team's Discord channel, eliminating manual triage and ensuring faster response times. This solution is ideal for businesses and support teams looking to streamline their customer service operations, reduce response delays, and improve internal communication by automatically categorizing and distributing inquiries, saving significant time and effort in managing support tickets.