What this workflow does
This workflow listens for voice messages sent to a Telegram bot and turns them into written text. It then checks the language of the text and translates it into another chosen language. It sends back the translation both as a text message and as a voice message in Telegram. This helps users understand voice messages in many languages without typing or copying manually.
The main problem solved is the difficulty of quickly understanding foreign voice messages. The workflow saves time and avoids errors by automating transcription and translation.
Who should use this workflow
People who get voice messages in different languages on Telegram and want quick translations.
Language learners and non-native speakers can respond faster without switching apps.
Anyone who wants an easy way to convert voice chats into readable and listenable translations.
Tools and services used
- Telegram Bot API: To receive voice messages and send replies.
- OpenAI API: For speech-to-text transcription and generating audio from text.
- LangChain Chat and Chain LLM nodes: To detect language and translate the transcribed text automatically.
- n8n Automation Platform: To connect and run all parts of the workflow.
How this workflow works: Input, Process, Output
Input
The input is any incoming voice message sent to the Telegram bot.
Process
First, the workflow catches the new voice message using the Telegram Trigger node.
Next, it downloads the voice file using the Telegram node configured to fetch the voice audio.
Then, the OpenAI node transcribes the voice audio into text.
The Chain LLM node reads the text and automatically detects its language. It then translates the text into the set target language or back to the original language depending on what was spoken.
Output
The workflow sends back two replies to the user in the Telegram chat: one is the translated text message, the other an audio voice message made from the translated text.
Beginner step-by-step: How to use this workflow in n8n
Download and import the workflow
- Download the workflow file using the Download button on this page.
- Inside your n8n editor, click on “Import from File” and select the downloaded workflow file.
Configure credentials and settings
- Add your Telegram Bot API credentials to the Telegram nodes.
- Add your OpenAI API Key to the OpenAI nodes.
- In the Settings node, update
language_nativeandlanguage_translatefields to your desired source and target languages, like “english” and “french”.
Test and activate
- Send a voice message to your Telegram bot to test if transcription and translation work.
- If everything works, activate the workflow in n8n by toggling the active switch.
Once activated, the workflow will run automatically and translate voice notes for you.
For users self hosting n8n, refer to self-host n8n for setup help.
Inputs and outputs detail
- Input: Telegram voice message file (voice.note.file_id)
- Intermediate data: Text transcription of voice audio
- Output 1: Translated text message sent back to Telegram chat
- Output 2: Translated text converted to voice audio and sent as Telegram audio message
Possible edge cases and failures
- Failure to download voice file if JSON path for file ID is wrong.
- Transcription might fail if the audio file format is unsupported or missing.
- Translation errors if language names in settings are misspelled or prompt is misconfigured.
- Reply may fail if dynamic chatId is not set correctly in Telegram response nodes.
Customization ideas
- Change the
language_nativeandlanguage_translatevalues in Settings to support any languages OpenAI Whisper recognizes. - Add features to handle text-only messages aside from voice notes.
- Modify reply message formats to include extra info like user name or time.
- Add logging integrations like Google Sheets or databases for history tracking.
Summary of results
✓ Save hours by automating voice message transcription and translation.
✓ Avoid manual errors when understanding foreign languages.
✓ Get replies in both text and voice for natural conversation flow.
→ Faster communication when dealing with messages in over 55 languages.
→ Easy integration in Telegram group chats or personal chats.
