Skip to main content

Create script-to-video avatar videos with GPT-4.1-mini, HeyGen, Google Drive, Gmail and Slack

Workflow preview

Workflow preview
100%
Create script-to-video avatar videos with GPT-4.1-mini, HeyGen, Google Drive, Gmail and Slack preview
Open on n8n.io

Important notice

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

1. Workflow Overview

Description This workflow automates the entire process of taking a raw user submitted script, rewriting it into a polished HeyGen ready narration, generating a full avatar video, handling all pr...

Best for

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

Tools used

n8n-nodes-base.httprequest, n8n-nodes-base.webhook, n8n-nodes-base.code, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.memorybufferwindow, @n8n/n8n-nodes-langchain.lmchatopenai, @n8n/n8n-nodes-langchain.outputparserstructured, n8n-nodes-base.wait

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Create script-to-video avatar videos with GPT-4.1-mini, HeyGen, Google Drive, Gmail and Slack
Workflow name
Create script-to-video avatar videos with GPT-4.1-mini, HeyGen, Google Drive, Gmail and Slack

📘 Description

This workflow automates the entire process of taking a raw user-submitted script, rewriting it into a polished HeyGen-ready narration, generating a full avatar video, handling all processing checks, retrieving the final MP4, uploading it to Google Drive, and notifying the user through email and Slack. It turns an unstructured script into a complete, ready-to-share video package without any manual intervention. The system rewrites scripts into structured sections (intro → narration sections → closing), ensures the final narration fits HeyGen’s free-tier limits, submits the script to HeyGen’s video API, initiates a polling loop until the video is fully rendered, downloads the finished file, uploads it to Drive with metadata, and generates clean notification messages containing the file links. Errors at any point trigger automated Slack alerts for debugging. This workflow replaces manual rewriting, video rendering, download/upload, and team communication—providing a fully-managed script-to-video pipeline.

⚙️ What This Workflow Does (Step-by-Step)

🟢 Receive Script Request via Webhook Captures the raw script payload submitted by the user. 🧹 Parse Incoming Script Payload Converts stringified JSON body into structured data for processing. ✍️ Rewrite & Structure Video Script Using AI Transforms the raw script into: • Video title • Intro • Multiple sections (title + narration) • Closing • Combined full_script optimized for HeyGen’s ~300–350 word limit Ensures natural, human narration with smooth transitions. 🧠 Script Writing Memory + LLM Engine Maintains writing consistency and uses GPT-4.1-mini to generate polished narration. 🧪 Validate Structured Script Output Enforces strict JSON schema for titles, sections, closing, and full_script. 🎞️ Submit Video Generation Request to HeyGen Sends structured script to HeyGen API with avatar, voice, and background settings for 1280×720 export. ⏳ Wait Before Polling Loop Initial delay before the first status check. 📡 Check HeyGen Video Status Queries the HeyGen API to check progress of the video generation. ⏳ Wait Before Rechecking Adds timed spacing between repeated polls. 🔍 Evaluate Video Completion If status = completed → proceed If still processing → loop back to polling sequence 📥 Download Generated HeyGen Video Retrieves the completed MP4 using the returned video_url. ☁️ Upload Video to Google Drive Uploads the MP4 to a specific Google Drive folder, returning: • File name • View link • Download link • Timestamp • Size metadata 📣 Generate Completion Notifications Using AI Creates two outputs: • A friendly short email summary • A concise Slack message Both containing the Google Drive file link. 🧠 Notification Memory + LLM Engine Maintains tone and ensures consistent messaging across channels. 🧪 Validate Notification Output JSON Ensures email_subject, email_body, and slack_message follow schema. 💬 Send Video Ready Slack Notification Posts the final Slack message containing file details and Drive link. 📧 Send Video Ready Email Notification Emails the summary and file link to the designated recipient. 🚨 Error Handler Trigger → Slack Alert Any workflow failure sends a detailed diagnostic alert with node name, message, and timestamp.

🧩 Prerequisites

• HeyGen API key • Google Drive OAuth connection • Slack API credentials • Gmail OAuth connection • Valid webhook endpoint to receive scripts

💡 Key Benefits

✔ Converts raw script → structured HeyGen-ready narration automatically ✔ Produces full HD avatar video with zero manual steps ✔ Polls HeyGen until the video is fully rendered ✔ Securely uploads final MP4 to Google Drive ✔ Auto-generates polished email + Slack notifications ✔ Ensures narrative consistency using memory context ✔ Provides real-time error alerts via Slack

👥 Perfect For

HR teams automating onboarding videos Marketing teams producing quick avatar explainers Training content creators Founders creating rapid how-to or announcement videos Anyone needing instant script-to-video automation

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 - Check HeyGen Video Status1

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

Block 2 - Receive Script Request

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

Block 3 - Parse Incoming Script Payload

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

Block 4 - Rewrite & Structure Video Script

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 2

Block 5 - Apply Script Writing Memory Context

Type / Role
@n8n/n8n-nodes-langchain.memoryBufferWindow - memoryBufferWindow
Config choices
Version 1.3

Block 6 - LLM Engine for Script Rewriting

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.3

Block 7 - Validate Structured Script Output

Type / Role
@n8n/n8n-nodes-langchain.outputParserStructured - outputParserStructured
Config choices
Version 1.3

Block 8 - Submit Video Generation Request to HeyGen

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

Block 9 - Wait Before Checking Video Status

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

Block 10 - Wait Before Rechecking Status

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

Block 11 - Evaluate Video Completion Status

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

Block 12 - Download Generated HeyGen Video

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

Block 13 - Upload Generated Video to Google Drive

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

Block 14 - Generate Completion Notifications

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 2

Block 15 - Apply Notification Context Memory

Type / Role
@n8n/n8n-nodes-langchain.memoryBufferWindow - memoryBufferWindow
Config choices
Version 1.3

Block 16 - LLM Engine for Notification Generation

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.3

Block 17 - Validate Notification Output JSON

Type / Role
@n8n/n8n-nodes-langchain.outputParserStructured - outputParserStructured
Config choices
Version 1.3

Block 18 - Send Video Ready Slack Notification

Type / Role
n8n-nodes-base.slack - slack
Config choices
Version 2.3

Block 19 - Send Video Ready Email Notification

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

Block 20 - Error Handler Trigger

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

Block 21 - Slack: Send Error Alert

Type / Role
n8n-nodes-base.slack - slack
Config choices
Version 2.3

Block 22 - Sticky Note8

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

Block 23 - Sticky Note

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

Block 24 - Sticky Note1

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

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

3. Summary Table

Workflow Create script-to-video avatar videos with GPT-4.1-mini, HeyGen, Google Drive, Gmail and Slack
Complexity advanced
Nodes 27
Categories Content Creation, Multimodal AI
Author Rahul Joshi
Published 15 Dec 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/11829/11829.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 Create script-to-video avatar videos with GPT-4.1-mini, HeyGen, Google Drive, Gmail and Slack do?

Description This workflow automates the entire process of taking a raw user submitted script, rewriting it into a polished HeyGen ready narration, generating a full avatar video, handling all pr...

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.