What this workflow does
This workflow answers Telegram messages automatically using AI.
It takes user messages sent to your Telegram bot, creates friendly replies with emojis, and sends them back fast.
This helps solve slow or missing responses in busy Telegram chats.
The result is quick, human-like replies that keep users happy and save time.
Who should use this workflow
Anyone managing active Telegram groups or channels with many messages.
It is good for community managers and support teams wanting to automate replies.
It helps cut down manual answering work and avoid delayed responses.
Basic n8n knowledge and API keys are needed.
Tools and services used
- Telegram Bot API: Receives user messages.
- n8n automation platform: Connects and manages workflow nodes.
- Langchain AI Agent node: Creates emoji-rich helpful replies.
- OpenAI Chat Model GPT-4o-Mini: Generates natural language responses.
Inputs, Processing Steps, and Outputs
Inputs
- Incoming messages from Telegram users to the bot.
Processing Steps
- Telegram Trigger node listens to new messages.
- AI Agent node builds a reply prompt including emojis.
- OpenAI Chat Model GPT-4o-Mini generates context-aware text based on the prompt.
- Generated reply text goes back to Telegram node.
- Telegram node sends the reply message back to the chat.
Output
- Automated, friendly, emoji-enhanced replies sent to Telegram chats quickly.
Beginner step-by-step: How to use this workflow in n8n
Step 1: Import workflow file
- Inside the n8n editor, click “Import from File.”
- Choose the downloaded workflow JSON file from this page.
Step 2: Configure credentials and details
- Add Telegram Bot API credentials to Telegram Trigger and Telegram nodes.
- Insert OpenAI API Key for the OpenAI Chat Model node.
- If needed, update IDs like chatId or message paths in nodes.
- Check the prompt text in AI Agent node:
=Respond to this as a helpful assistant with emojis: {{ $json.message.text }}Make sure it is included exactly to get emoji replies.
Step 3: Test the workflow
- Try sending a message to the Telegram bot in your chat.
- Confirm the workflow replies promptly with a friendly, emoji-rich answer.
Step 4: Activate for production
- Switch the workflow status to active in n8n.
- Monitor executions for errors or API issues.
For stability, use self-host n8n if running on your own server.
Customization ideas
- Change the AI prompt in AI Agent node to adjust reply style.
- Switch model in OpenAI Chat Model node to other GPT versions.
- Add logging nodes after AI Agent to save chat replies.
- Insert filter nodes to ignore bot messages or keywords.
- Duplicate for multiple Telegram bots with different credentials.
Handling edge cases and failures
Webhook not receiving messages
Cause: Wrong bot API key or webhook not set on Telegram.
Fix: Check correct API token and re-register webhook URL from Telegram Trigger node.
Empty or error AI responses
Cause: Invalid OpenAI API Key or quota exceeded.
Fix: Verify and update OpenAI credentials and subscription status.
Summary of results
✓ Fast, friendly Telegram replies with emojis.
✓ Saves manual reply time.
✓ Keeps chat users satisfied.
✓ Easy to configure and run inside n8n.
✓ Works automatically without manual steps.
