Skip to main content

Generate AI avatar videos from text with HeyGen and upload to YouTube

Workflow preview

Workflow preview
100%
Generate AI avatar videos from text with HeyGen and upload to YouTube preview
Open on n8n.io

Important notice

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

1. Workflow Overview

Create Video with HeyGen and Upload to YouTube Overview This workflow automates the process of creating an AI generated avatar video using HeyGen and directly uploading it to YouTube . By sending t...

Best for

  • Content Creation automation workflows
  • Multimodal AI automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.webhook, n8n-nodes-base.code, n8n-nodes-base.set, n8n-nodes-base.httprequest, n8n-nodes-base.wait, n8n-nodes-base.if, n8n-nodes-base.youtube

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Generate AI avatar videos from text with HeyGen and upload to YouTube
Workflow name
Generate AI avatar videos from text with HeyGen and upload to YouTube

Create Video with HeyGen and Upload to YouTube

Overview

This workflow automates the process of creating an AI-generated avatar video using HeyGen and directly uploading it to YouTube. By sending text input via a webhook, the workflow generates a video with a chosen avatar and voice, waits for processing, downloads the completed file, and publishes it to your configured YouTube channel.

This template is ideal for automating content creation pipelines, such as daily news updates, explainer videos, or narrated scripts, without manual intervention.


Use Case

  • Marketing teams: Automate explainer or promotional video creation from text input.
  • Content creators: Generate AI-based avatar videos for YouTube directly from scripts.
  • Organizations: Streamline video generation for announcements, product updates, or tutorials.

Instead of recording and editing videos manually, this template allows you to feed text content into a webhook and have a ready-to-publish video on your YouTube channel within minutes.


How It Works

  1. Webhook Trigger: The workflow starts when text content and a title are sent to the webhook endpoint.
  2. Code Node: Cleans and formats the input text by removing unnecessary newlines and returns it with the title.
  3. Set Node: Prepares HeyGen parameters, including API key, avatar ID, voice ID, title, and content.
  4. HeyGen API Call: Sends the request to generate a video with the provided avatar and voice.
  5. Wait Node: Pauses briefly to allow HeyGen to process the video.
  6. Video Status Check: Polls HeyGen to check whether the video has finished processing.
  7. Conditional Check: If the video is still processing, it loops back to wait. Once complete, it moves forward.
  8. Download Node: Retrieves the generated video file.
  9. YouTube Upload Node: Uploads the video to your YouTube channel with the provided title and default settings.

Requirements

  • HeyGen API Key: Required to authenticate with HeyGen’s video generation API.
  • HeyGen Avatar & Voice IDs: Unique identifiers for the avatar and voice you want to use.
  • YouTube OAuth2 Credentials: Connected account for video uploads.

Setup Instructions

  1. Import the Workflow: Download and import this template JSON into your n8n instance.

  2. Configure the Webhook: Copy the webhook URL from n8n and use it to send requests with title and content.

    • Example payload:
      {
        "title": "Tech News Update",
        "content": "Today’s top story is about AI advancements in video generation..."
      }
      
  3. Add HeyGen Credentials:

    • Insert your HeyGen API key in the Set Node under x-api-key.
    • Provide your chosen avatar_id and voice_id from HeyGen.
      • To find your HeyGen avatar_id and voice_id, first retrieve your API key from the HeyGen dashboard. With this key, you can use HeyGen’s API to look up available options: run a GET request to https://api.heygen.com/v2/avatars to see a list of avatars along with their avatar_id, and then run a GET request to https://api.heygen.com/v2/voices to see a list of voices with their voice_id. Once you’ve identified the avatar and voice you want to use, copy their IDs and paste them into the Set HeyGen Parameters node in your n8n workflow.
  4. Set Up YouTube Credentials:

    • Connect your YouTube account in n8n using OAuth2.
    • Ensure proper permissions are granted for video uploads.
      • To set up YouTube credentials in n8n, go to the Google Cloud Console, enable YouTube Data API v3, and create an OAuth Client ID (choose Web Application and add the redirect URI: https://<your-n8n-domain>/rest/oauth2-credential/callback). Copy the Client ID and Client Secret, then in n8n create new credentials for YouTube OAuth2 API. Enter the values, authenticate with your Google account to grant upload permissions, and test the connection. Once complete, the YouTube node will be ready to upload videos automatically.
  5. Activate the Workflow: Once configured, enable the workflow. Sending a POST request to the webhook with title and content will trigger the full process.


Notes

  • You can adjust video dimensions (default: 1280x720) in the HeyGen API request.
  • Processing time may vary depending on script length. The workflow uses a wait-and-poll loop until the video is ready.
  • Default YouTube upload category is Education (28) and region is US. These can be customized in the YouTube node.

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 - Sticky - Webhook Contract & Security

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

Block 2 - WebHook

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2.1

Block 3 - Sticky - Normalize Text for TTS

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

Block 4 - Code

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 5 - Sticky - Parameter Staging (Secrets & IDs)

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

Block 6 - Setup Heygen Parameters

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3

Block 7 - Sticky - Create HeyGen Job (v2)

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

Block 8 - Create Avatar Video (HeyGen)

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4

Block 9 - Sticky - Polling Cycle

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

Block 10 - Wait for Video (HeyGen)

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

Block 11 - Get Avatar Video Status (HeyGen)

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4

Block 12 - If Processing Completed

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

Block 13 - Sticky - Download Result (Binary)

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

Block 14 - Download Video

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4

Block 15 - Sticky - YouTube Upload (Binary Property & Metadata)

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

Block 16 - Upload a video

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

Block 17 - Sticky - Polling Cycle1

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

3. Summary Table

Workflow Generate AI avatar videos from text with HeyGen and upload to YouTube
Complexity advanced
Nodes 17
Categories Content Creation, Multimodal AI
Author Nishant Rayan
Published 16 Sept 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/8622/8622.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 Generate AI avatar videos from text with HeyGen and upload to YouTube do?

Create Video with HeyGen and Upload to YouTube Overview This workflow automates the process of creating an AI generated avatar video using HeyGen and directly uploading it to YouTube . By sending t...

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 Content Creation, Multimodal AI use case.