Skip to main content

Transcribing Telegram voice messages using Whisper and Gemini with a fallback mechanism

Workflow preview

Workflow preview
100%
Transcribing Telegram voice messages using Whisper and Gemini with a fallback mechanism preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

️ n8n Workflow: Voice Message Transcription with Access Control This n8n workflow enables automated transcription of voice messages in Telegram groups with built in access control and intelligent...

Best for

  • Document Extraction automation workflows
  • Multimodal AI automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.telegramtrigger, n8n-nodes-base.telegram, n8n-nodes-base.stickynote, n8n-nodes-base.if, n8n-nodes-base.switch, n8n-nodes-base.set, @n8n/n8n-nodes-langchain.openai, @n8n/n8n-nodes-langchain.googlegemini

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Yehor EGMS.

Original n8n.io source

1.1 Workflow description

Title
Transcribing Telegram voice messages using Whisper and Gemini with a fallback mechanism
Workflow name
Transcribing Telegram voice messages using Whisper and Gemini with a fallback mechanism

🎙️ n8n Workflow: Voice Message Transcription with Access Control

This n8n workflow enables automated transcription of voice messages in Telegram groups with built-in access control and intelligent fallback mechanisms. It's designed for teams that need to convert audio messages to text while maintaining security and handling various audio formats.


📌 Section 1: Trigger & Access Control

⚡ Receive Message (Telegram Trigger)

Purpose: Captures incoming messages from users in your Telegram group.

How it works: When a user sends a message (voice, audio, or text), the workflow is triggered and the sender's information is captured.

Benefit: Serves as the entry point for the entire transcription pipeline.

🔐 Sender Verification

Purpose: Validates whether the sender has permission to use the transcription service.

Logic: Check sender against authorized users list If authorized → Proceed to next step If not authorized → Send "Access denied" message and stop workflow

Benefit: Prevents unauthorized users from consuming AI credits and accessing the service.


📌 Section 2: Message Type Detection

🎵 Audio/Voice Recognition

Purpose: Identifies the type of incoming message and audio format.

Why it's needed: Telegram handles different audio types with different statuses:

  • Voice notes (voice messages)
  • Audio files (standard audio attachments)
  • Text messages (no audio content)

Process:

  1. Check if message contains audio/voice content
  2. If no audio file detected → Send "No audio file found" message
  3. If audio detected → Assign file ID and proceed to format detection

🧩 File Type Determination (IF Node)

Purpose: Identifies the specific audio format for proper processing.

Supported formats:

  • OGG (Telegram voice messages)
  • MPEG/MP3
  • MP4/M4A
  • Other audio formats

Logic:

If format recognized → Proceed to transcription If format not recognized → Send "File format not recognized" message

Benefit: Ensures compatibility with transcription services by validating file types upfront.


📌 Section 3: Primary Transcription (OpenAI)

📥 File Download

Purpose: Downloads the audio file from Telegram for processing.

🤖 OpenAI Transcription

Purpose: Transcribes audio to text using OpenAI's Whisper API.

Why OpenAI: High-quality transcription with cost-effective pricing.

Process:

  1. Send downloaded file to OpenAI transcription API
  2. Simultaneously send notification: "Transcription started"
  3. If successful → Assign transcribed text to variable and proceed
  4. If error occurs → Trigger fallback mechanism

Benefit: Fast, accurate transcription with multi-language support.


📌 Section 4: Fallback Transcription (Gemini)

🛟 Gemini Backup Transcription

Purpose: Provides a safety net if OpenAI transcription fails.

Process:

  1. Receives file only if OpenAI node returns an error
  2. Downloads and processes the same audio file
  3. Sends to Google Gemini for transcription
  4. Assigns transcribed text to the same text variable

Benefit: Ensures high reliability—if one service fails, the other takes over automatically.


📌 Section 5: Message Length Handling

📏 Text Length Check (IF Node)

Purpose: Determines if the transcribed text exceeds Telegram's character limit.

Logic:

If text ≤ 4000 characters → Send directly to Telegram If text > 4000 characters → Split into chunks

Why: Telegram has a 4,000-character limit per message.

✂️ Text Splitting (Code Node)

Purpose: Breaks long transcriptions into 4,000-character segments.

Process:

  1. Receives text longer than 4,000 characters
  2. Splits text into chunks of ≤4,000 characters
  3. Maintains readability by avoiding mid-word breaks
  4. Outputs array of text chunks

📌 Section 6: Response Delivery

💬 Send Transcription (Telegram Node)

Purpose: Delivers the transcribed text back to the Telegram group.

Behavior:

  • Short messages: Sent as a single message
  • Long messages: Sent as multiple sequential messages

Benefit: Users receive complete transcriptions regardless of length, ensuring no content is lost.


📊 Workflow Overview Table

Section Node Name Purpose
1. Trigger Receive Message Captures incoming Telegram messages
2. Access Control Sender Verification Validates user permissions
3. Detection Audio/Voice Recognition Identifies message type and audio format
4. Validation File Type Check Verifies supported audio formats
5. Download File Download Retrieves audio file from Telegram
6. Primary AI OpenAI Transcription Main transcription service
7. Fallback AI Gemini Transcription Backup transcription service
8. Processing Text Length Check Determines if splitting is needed
9. Splitting Code Node Breaks long text into chunks
10. Response Send to Telegram Delivers transcribed text

🎯 Key Benefits

  • 🔐 Secure access control: Only authorized users can trigger transcriptions
  • 💰 Cost management: Prevents unauthorized credit consumption
  • 🎵 Multi-format support: Handles various Telegram audio types
  • 🛡️ High reliability: Dual-AI fallback ensures transcription success
  • 📱 Telegram-optimized: Automatically handles message length limits
  • 🌍 Multi-language: Both AI services support numerous languages
  • Real-time notifications: Users receive status updates during processing
  • 🔄 Automatic chunking: Long transcriptions are intelligently split
  • 🧠 Smart routing: Files are processed through the optimal path
  • 📊 Complete delivery: No content loss regardless of transcription length

🚀 Use Cases

  • Team meetings: Transcribe voice notes from team discussions
  • Client communications: Convert client voice messages to searchable text
  • Documentation: Create text records of verbal communications
  • Accessibility: Make audio content accessible to all team members
  • Multi-language teams: Leverage AI transcription for various languages

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Telegram Trigger1

Type / Role
n8n-nodes-base.telegramTrigger - telegramTrigger
Config choices
Version 1.2

Block 2 - MSG - Starting transcription. Please wait.

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 3 - MSG - Access denied!

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 4 - MSG - No file!

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 5 - Get File GPT

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 6 - Get File Gemini

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 7 - MSG - File not recognized

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 8 - MSG - Output

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 9 - MSG - Output with chunking

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 10 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 11 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 12 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 13 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 14 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 15 - Sticky Note5

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 16 - Sticky Note6

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 17 - Sticky Note7

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 18 - Sticky Note8

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 19 - Sticky Note9

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 20 - Sticky Note10

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 21 - Sticky Note12

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 22 - Sticky Note13

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 23 - Access Check

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 24 - Determining The Type Of Document

Type / Role
n8n-nodes-base.switch - switch
Config choices
Version 3.2

Showing the first 24 of 33 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Transcribing Telegram voice messages using Whisper and Gemini with a fallback mechanism
Complexity advanced
Nodes 33
Categories Document Extraction, Multimodal AI
Author Yehor EGMS
Published 14 Oct 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/9625/9625.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Transcribing Telegram voice messages using Whisper and Gemini with a fallback mechanism do?

️ n8n Workflow: Voice Message Transcription with Access Control This n8n workflow enables automated transcription of voice messages in Telegram groups with built in access control and intelligent...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Document Extraction, Multimodal AI use case.