Telegram Messaging Agent for Text, Audio, and Images
detail.loadingPreview
Automate Telegram interactions by processing text, audio, and image messages. This workflow uses a webhook to listen for events, checks user/chat IDs, and leverages OpenAI for analysis and transcription. It handles various message types with specific nodes.
🚀Ready to Deploy This Workflow?
About This Workflow
Overview
This n8n workflow acts as a versatile Telegram messaging agent, capable of handling text, audio, and image messages. It's built around a webhook listener (Listen for Telegram Events) that triggers when a message is received. The workflow first checks if the incoming message is from a recognized user or chat ID to ensure proper handling and prevent unauthorized interactions. For text messages, it can pass them to an OpenAI chat model (gpt-4o-mini) for processing. For audio messages, it retrieves the file using the Telegram node (Get Audio File), transcribes it using OpenAI's whisper model (Transcribe Recording), and then processes the transcription with another OpenAI chat model (gpt-4o-mini). For images, it retrieves the file, stores its file ID and caption in Image Schema, and then sends the image to OpenAI for analysis (Analyze Image). The workflow also includes nodes for setting and testing Telegram webhooks, and an error message node for handling issues.
Key Features
- Listens for Telegram messages via a webhook.
- Processes text, audio, and image message types.
- Authenticates sender by checking User & Chat ID.
- Utilizes OpenAI for text analysis, audio transcription, and image analysis.
- Retrieves Telegram files (audio, images) directly.
- Includes utilities for setting and testing Telegram bot webhooks.
How To Use
- Set up Telegram Bot: Create a Telegram bot using BotFather and obtain your bot token.
- Configure Webhook: Use the
Set Webhook Test URLandGet Telegram Webhook Infonodes (or manually set the webhook via API) to point Telegram updates to your n8n instance's webhook URL. Ensure your n8n instance is publicly accessible. - Configure Nodes:
- Replace
your-endpointin theListen for Telegram Eventsnode with your desired webhook path. - Enter your Telegram bot token in the
Telegram accountcredential. - Enter your OpenAI API key in the
OpenAi accountcredential. - Adjust the
chatIdin theError messagenode if needed. - Customize the
Check User & Chat IDnode's conditions to match your desired user/chat IDs.
- Replace
- Run Workflow: Activate the webhook and send messages (text, audio, images) to your Telegram bot to test its functionality.
Apps Used
Workflow JSON
{
"id": "63cf874e-3ec0-49ea-8b11-517db600c428",
"name": "Telegram Messaging Agent for Text, Audio, and Images",
"nodes": 0,
"category": "Telegram Automation",
"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: 63cf874e-3ec0...
About the Author
Free n8n Workflows Official
System Admin
The official repository for verified enterprise-grade workflows.
Statistics
Verification Info
Related Workflows
Discover more workflows you might like
Automated Telegram Image Analysis with OpenAI
This n8n workflow automatically analyzes images sent via Telegram using OpenAI. It triggers on image reception, processes the image with OpenAI, and sends the analysis back to the Telegram chat.
Automate Daily Vegan Recipes via Telegram Bot
This workflow automatically sends daily vegan recipes to Telegram users. It uses the Cron node to trigger the process, Airtable to manage chat IDs, and the Spoonacular API to fetch recipes.
Telegram AI Chatbot with OpenAI Integration
Automate your Telegram messaging with an AI-powered chatbot using OpenAI Chat Model. This workflow triggers on new Telegram messages and sends AI-generated responses back to the chat.