Smart Telegram AI Chatbot
detail.loadingPreview
Automate your Telegram interactions with a powerful AI chatbot. This workflow allows your bot to respond intelligently to messages, generate welcome greetings, and even create images based on user requests.
About This Workflow
This n8n workflow empowers you to build an intelligent Telegram bot capable of engaging in natural language conversations, welcoming new users, and generating custom images on demand. Leveraging OpenAI's advanced models, the bot dynamically adjusts its responses based on user input and predefined system instructions. It intelligently routes commands for direct chat, image generation, or a friendly welcome message, ensuring a rich and interactive user experience. The workflow also includes error handling for unsupported commands, making it robust and user-friendly. This is an excellent starting point for anyone looking to enhance their Telegram presence with AI capabilities.
Key Features
- AI-Powered Chat: Engage in natural, context-aware conversations powered by OpenAI's GPT models.
- Dynamic Welcome Messages: Automatically greet new users in their preferred language.
- Image Generation: Create unique images from text prompts using OpenAI's DALL-E integration.
- Command Handling: Easily manage different bot functionalities with distinct commands like
/startand/image. - Customizable AI Settings: Fine-tune AI behavior with parameters like model temperature and token length.
How To Use
- Set up Telegram Bot: Create a new bot in Telegram via BotFather and obtain the API token. Add this token to your n8n credentials under
Telegram API. - Configure OpenAI Credentials: Obtain your OpenAI API key and add it to your n8n credentials under
OpenAI Account. - Add Telegram Trigger: Use the
Telegram Triggernode to start your workflow. Configure it to listen for all updates (*). - Define Bot Behavior: Use the
Settingsnode to define system prompts, model temperature, and token length. You can also configure the bot's typing action based on commands. - Command Routing: Utilize the
CheckCommandnode to direct incoming messages. Configure rules to differentiate between general chat,/startcommands, and/imagerequests. - AI Chat and Greeting: For general chat, use the
OpenAInode configured forchatwith your system prompt. For/startcommands, use a separateOpenAInode to generate a welcome message. - Image Generation: For
/imagecommands, use theOpenAInode configured forimagegeneration, extracting the prompt from the user's message. - Send Responses: Use the
Telegramnodes (Text reply,Send Typing action) to send appropriate responses and typing indicators back to the user. - Error Handling: Connect the
Sticky Note(or aSend error messagenode if available) to the fallback output of theCheckCommandto handle unsupported commands gracefully.
Apps Used
Workflow JSON
{
"id": "870c3b91-2c99-4d94-9046-7507e9975328",
"name": "Smart Telegram AI Chatbot",
"nodes": 24,
"category": "Marketing",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: 870c3b91-2c99...
About the Author
SaaS_Connector
Integration Guru
Connecting CRM, Notion, and Slack to automate your life.
Statistics
Related Workflows
Discover more workflows you might like
Automated Multi-Platform Social Media Publisher
Streamline your social media content creation and publishing with this n8n workflow. Simply fill out a web form with your caption, media (image or video), and target platforms, and let n8n automate the posting process across multiple social networks.
WhatsApp AI Assistant: LLaMA 4 & Google Search for Real-Time Insights
Instantly deploy a smart AI assistant on WhatsApp, powered by Groq's lightning-fast LLaMA 4 model. This workflow enables real-time conversations, remembers context, and provides up-to-date answers by integrating live Google Search results.
AI-Powered On-Page SEO Audit & Report Automation
Instantly generate comprehensive on-page SEO technical and content audits for any website URL. This AI-powered workflow automates the entire process, from scraping the page to delivering a detailed report directly to your inbox, empowering you to optimize for better search rankings and user engagement.