Skip to main content

Generate AI avatar videos from scripts using ElevenLabs and HeyGen

Workflow preview

Generate AI avatar videos from scripts using ElevenLabs and HeyGen preview
Open on n8n.io

Important notice

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

Overview

๐Ÿ“Š Description

Automate end-to-end AI video creation by transforming text scripts into professional avatar videos with natural voiceovers. ๐ŸŽฌ๐Ÿค– This workflow receives a script via webhook, generates realistic audio using ElevenLabs, creates an AI avatar video through HeyGen, continuously polls for completion, and uploads the final MP4 file to Google Drive. The completed video is also returned directly via webhook for frontend or app usage. Perfect for product demos, onboarding videos, explainers, and content platforms that need scalable video generation without manual editing. ๐Ÿš€๐Ÿ“น

๐Ÿ” What This Template Does

1๏ธโƒฃ Receives a POST request containing script, avatar ID, voice ID, and style via webhook. ๐ŸŒ 2๏ธโƒฃ Extracts and validates request parameters for processing. ๐Ÿงพ 3๏ธโƒฃ Generates natural-sounding voiceover audio using ElevenLabs. ๐ŸŽ™๏ธ 4๏ธโƒฃ Uploads the generated audio file to HeyGen as a video asset. โฌ†๏ธ 5๏ธโƒฃ Creates an AI avatar video using the selected HeyGen avatar and audio track. ๐Ÿค–๐ŸŽฅ 6๏ธโƒฃ Polls HeyGen every few seconds until video generation is complete. โณ 7๏ธโƒฃ Retrieves video URLs, captions, thumbnails, and metadata. ๐Ÿ“Š 8๏ธโƒฃ Downloads the finished MP4 video file. โฌ‡๏ธ 9๏ธโƒฃ Uploads the final video to Google Drive with structured naming. โ˜๏ธ ๐Ÿ”Ÿ Returns the video file via webhook response for frontend display or download. ๐Ÿ” 1๏ธโƒฃ1๏ธโƒฃ Sends Slack alerts automatically if any workflow error occurs. ๐Ÿšจ

โญ Key Benefits

โœ… Converts plain text into studio-quality avatar videos automatically โœ… Uses human-like AI voiceovers from ElevenLabs โœ… Eliminates manual video recording, editing, and rendering โœ… End-to-end automation from script โ†’ video โ†’ Drive โœ… Frontend-ready with webhook video response โœ… Ideal for scalable video content production

๐Ÿงฉ Features

  • Webhook-based video generation trigger
  • ElevenLabs multilingual text-to-speech integration
  • HeyGen AI avatar video creation
  • Dynamic avatar, voice, and style selection
  • Polling loop to handle async video rendering
  • Google Drive video upload
  • Binary video return via webhook
  • Slack-based error handling and alerts

๐Ÿ” Requirements

  • ElevenLabs API key (voice generation)
  • HeyGen API key (avatar video creation)
  • Google Drive OAuth2 credentials
  • Slack API credentials (optional, for error alerts)
  • Webhook client sending script, avatar_id, voice_id, and video_style

๐ŸŽฏ Target Audience

  • SaaS teams creating onboarding or explainer videos
  • Content creators producing AI talking-head videos
  • EdTech platforms generating video lessons
  • Marketing teams scaling video production
  • Automation teams building AI video pipelines