Unlock Seamless Telegram-to-AI Communication
detail.loadingPreview
Effortlessly automate your Telegram communication by transforming voice and text messages into actionable data for AI. This workflow bridges the gap between your instant messaging and powerful AI tools.
About This Workflow
This n8n workflow automates the processing of incoming Telegram messages, intelligently distinguishing between voice and text inputs. For voice messages, it retrieves the audio file, leverages OpenAI's Whisper API for accurate transcription, and prepares the text for further AI processing. Text messages are directly prepared for AI interaction. The core of this workflow lies in its ability to act as a smart gateway, ensuring that both spoken and written communication from Telegram can be seamlessly integrated into your AI-powered operations, from content creation to data analysis. It's designed to be the first step in a more complex automation, making your interactions with AI more fluid and accessible.
Key Features
- Intelligent Message Routing: Automatically detects and separates voice and text messages from Telegram.
- Voice-to-Text Transcription: Utilizes OpenAI's Whisper API to accurately convert voice messages into readable text.
- Streamlined AI Integration: Prepares both voice-transcribed and direct text messages for further AI processing.
- Flexible Workflow Foundation: Serves as a robust starting point for complex automation sequences involving AI agents and other tools.
- Secure Credential Management: Supports secure connection to Telegram and OpenAI APIs.
How To Use
- Connect Telegram: Configure the 'Receive Telegram Messages' node with your Telegram bot token and desired chat updates (e.g., 'message').
- Define Message Type: Set up the 'Voice or Text?' switch node. Configure the 'Audio' output to check for
{{ $json.message.voice.file_id }}, the 'Text' output to check for{{ $json.message.text || "" }}, and an 'Error' output for any other cases. - Fetch Voice Messages: For the 'Audio' output, add the 'Fetch Voice Message' node, using
{{ $json.message.voice.file_id }}to retrieve the audio file. - Transcribe Audio: Connect the 'Fetch Voice Message' node to the 'Transcribe Voice to Text' node, ensuring your OpenAI API credentials are set up.
- Prepare Text for AI: For both direct text messages and transcribed audio, use the 'Prepare for LLM' node to extract and format the text into a variable like
text(e.g.,={{$json.message.text}}). - AI Agent Integration: Connect the prepared text to your subsequent AI nodes, such as the 'AI Agent' node, configuring its input with the
textvariable.
Apps Used
Workflow JSON
{
"id": "4a028462-b2a5-4097-89fe-a2ec42bc6fe8",
"name": "Unlock Seamless Telegram-to-AI Communication",
"nodes": 29,
"category": "Operations",
"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: 4a028462-b2a5...
About the Author
Free n8n Workflows Official
System Admin
The official repository for verified enterprise-grade workflows.
Statistics
Related Workflows
Discover more workflows you might like
Universal CSV to JSON API Converter
Effortlessly transform CSV data into structured JSON with this versatile n8n workflow. Integrate it into any application as a custom API endpoint, supporting various input methods including file uploads and raw text.
Instant WooCommerce Order Notifications via Telegram
When a new order is placed on your WooCommerce store, instantly receive detailed notifications directly to your Telegram chat. Stay on top of your e-commerce operations with real-time alerts, including order specifics and a direct link to view the order.
On-Demand Microsoft SQL Query Execution
This workflow allows you to manually trigger and execute any SQL query against your Microsoft SQL Server database. Perfect for ad-hoc data lookups, administrative tasks, or quick tests, giving you direct control over your database operations.