AI Video Generator from Telegram Voice Notes (Using HeyGen & OpenAI) - n8n Workflow

Effortlessly create user-generated content (UGC) videos from Telegram voice messages. This powerful n8n workflow uses the OpenAI n8n node for transcription and HeyGen via HTTP to generate AI videos automatically.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Ideal User Persona

Content Creators: Individuals looking to automate the conversion of spoken ideas (voice notes) into visual content.
Marketing Teams: Teams wanting to quickly produce UGC-style video snippets for social media from internal communications.
n8n Developers: Users seeking advanced examples of integrated AI services, including loops and asynchronous API polling within an n8n workflow.
Automation Specialists: Anyone who needs robust n8n templates for handling media files and external APIs like HeyGen and OpenAI.

Overview

This automation solves the challenge of manually transforming voice messages into high-quality, consumable video content. By leveraging a sophisticated n8n workflow, the process becomes instantaneous. When a voice note is received on Telegram, the n8n trigger captures it. The file is downloaded, transcribed accurately using the OpenAI n8n node's powerful models, and then passed to HeyGen for avatar-based video generation. The core value of this n8n template lies in its asynchronous handling, utilizing a status check loop that polls the HeyGen API until the video is complete, ensuring reliable delivery of the final product back to the user via Telegram. This specific n8n workflow showcases how seamless AI integration can be.

How it Works

This powerful n8n workflow operates entirely automatically once configured:


  1. Message Trigger: The n8n trigger, specifically a Telegram Trigger n8n node, initiates the n8n workflow when a new voice message is received in the specified Telegram chat or bot.

  2. File Download: The Telegram n8n node downloads the actual voice note file from the platform.

  3. Transcription: The downloaded voice note is sent to the OpenAI n8n node (using the LangChain integration) which performs high-accuracy transcription, converting the audio into text.

  4. Data Preparation: A Set n8n node standardizes the data structure, extracting the transcribed text and necessary chat IDs required for subsequent API calls and final reply.

  5. Video Generation Request: An HTTP Request n8n node calls the HeyGen API, submitting the transcribed text to start the video generation process, receiving a job ID in return. This is a critical step in the n8n workflow.

  6. Status Polling (Loop): The workflow enters an automated polling loop. An HTTP Request n8n node continuously checks the video status using the received job ID.

  7. Completion Check: An If n8n node checks if the video status is marked as 'completed'.

  8. Waiting Period: If the video is not ready, a Wait n8n node pauses the n8n workflow for 10 seconds (the '10s Buffer') before looping back to re-check the status, preventing unnecessary load and efficiently managing asynchronous tasks.

  9. Final Delivery: Once complete, a Set n8n node formats the final output containing the video URL, which is then sent back to the original chat via a final Telegram n8n node, completing the automated n8n workflow.

Installation Guide

To deploy this comprehensive n8n workflow, follow these steps:


  1. Import: Copy the provided n8n workflow JSON code and paste it into your n8n instance using the 'New' -> 'Import from JSON' option.

  2. Credentials Setup:

Telegram: Configure credentials for the Telegram n8n node (API key and chat IDs).
OpenAI: Set up the API key for the OpenAI n8n node used for transcription.
* HeyGen: Configure the necessary HTTP Request n8n nodes with your HeyGen API key and base URLs.

  1. Webhook Activation: Ensure the Telegram Trigger n8n node is correctly configured to listen for incoming messages. Activate the n8n workflow.

  2. Customization: Adjust the parameters within the HTTP Request n8n node (Generating Video) to select your preferred HeyGen avatar, background, and aspect ratio.

This n8n template requires external service credentials to function fully.

Node Details

This n8n workflow utilizes several key nodes to achieve its goal:

Message Trigger (Telegram Trigger n8n node):
Function: Starts the n8n workflow upon receiving a new message (specifically voice notes).
Key Configuration: Configured as a webhook trigger listening for incoming updates.
Downloading File (Telegram n8n node):
Function: Downloads the voice note content linked in the trigger payload.
Key Configuration: Uses the file resource to fetch the actual audio data.
Transcribing voice memo (OpenAI n8n node):
Function: Processes the audio file to generate a text transcript.
Key Configuration: Configured for transcription/speech-to-text operation, typically using the Whisper model via the OpenAI integration.
Generating Video (HTTP Request n8n node):
Function: Initiates the video creation job on the HeyGen platform, passing the transcribed text as the script.
Key Configuration: POST request to the HeyGen API endpoint for video generation, including the dynamic script input from the previous n8n node.
Video Status Update (HTTP Request n8n node):
Function: Periodically checks the status of the video job.
Key Configuration: GET request to the HeyGen status endpoint, using the job ID set in the previous n8n node.
is Completed (If n8n node):
Function: Controls the polling loop, determining if the video creation process is finished.
Key Configuration: Checks the status field returned by the HeyGen API for a 'completed' value.
10s Buffer (Wait n8n node):
Function: Implements a fixed 10-second delay if the video is not yet complete, crucial for managing API rate limits and efficient waiting in the n8n workflow loop.

Related n8n Workflows

Paid

Nodes: 8 Nodes
Updated: December 26 2025
View all
Created by

Rahul Joshi is a seasoned technology leader specializing in the n8n automation tool and AI-driven workflow automation. With deep expertise in building open-source workflow automation and self-hosted automation platforms, he helps organizations eliminate manual processes through intelligent n8n ai agent automation solutions.

Featured*