AutomationFlowsAI & RAG › Create Script-to-video Avatar Videos with Gpt-4.1-mini, Heygen, Google…

Create Script-to-video Avatar Videos with Gpt-4.1-mini, Heygen, Google…

Original n8n title: Create Script-to-video Avatar Videos with Gpt-4.1-mini, Heygen, Google Drive, Gmail and Slack

ByRahul Joshi @rahul08 on n8n.io

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…

Webhook trigger★★★★☆ complexityAI-powered27 nodesHTTP RequestAgentMemory Buffer WindowOpenAI ChatOutput Parser StructuredGoogle DriveSlackGmail
AI & RAG Trigger: Webhook Nodes: 27 Complexity: ★★★★☆ AI nodes: yes Added:

This workflow corresponds to n8n.io template #11829 — we link there as the canonical source.

This workflow follows the Agent → Error Trigger recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "id": "tF9rFnUThB6yHXoy",
  "name": "AI-Powered Script-to-Video Automation Workflow with Loveable UI And HeyGen",
  "tags": [],
  "nodes": [
    {
      "id": "fc6aea6d-7259-4e2a-8c0e-f96f8c80d68b",
      "name": "Check HeyGen Video Status1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        720,
        1344
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "e67dc0e6-07b5-49bb-99bb-ef62974d8c2b",
      "name": "Receive Script Request ",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -1232,
        1424
      ],
      "parameters": {},
      "typeVersion": 2.1
    },
    {
      "id": "b1514593-ffb3-4ce9-82cc-868130acfabb",
      "name": "Parse Incoming Script Payload",
      "type": "n8n-nodes-base.code",
      "position": [
        -944,
        1424
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "cc8ee808-65a9-452e-af2d-d44a5eb334e9",
      "name": "Rewrite & Structure Video Script ",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -624,
        1424
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "0c34a43e-d9ff-499f-9eb2-22d5c6fa0aff",
      "name": "Apply Script Writing Memory Context",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        -544,
        1760
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "0a2b1ddf-305a-410c-ad4b-c992e4edd5a3",
      "name": "LLM Engine for Script Rewriting",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -768,
        1744
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "cf1bc913-3ea4-4efc-8ad8-7dbf21c6ba64",
      "name": "Validate Structured Script Output",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -352,
        1728
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "0afeb153-a523-4d8e-b44c-270bda2a2c93",
      "name": "Submit Video Generation Request to HeyGen",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        48,
        1424
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "1ae23d16-9812-4069-9055-0c8d2df2cc0e",
      "name": "Wait Before Checking Video Status",
      "type": "n8n-nodes-base.wait",
      "position": [
        496,
        1424
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "705f5697-41ec-4985-b26d-c8d1d93aa649",
      "name": "Wait Before Rechecking Status",
      "type": "n8n-nodes-base.wait",
      "position": [
        944,
        1344
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "ee115c09-f2ff-4023-b6b9-0d4926de02d7",
      "name": "Evaluate Video Completion Status",
      "type": "n8n-nodes-base.if",
      "position": [
        1168,
        1424
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "63c5271d-1b77-4250-9ac2-121a5e5c1f55",
      "name": "Download Generated HeyGen Video",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1584,
        1424
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "507da046-8767-42d0-9a79-9012737b9e43",
      "name": "Upload Generated Video to Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1824,
        1424
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "bec0536a-83fd-4585-87a4-6812b450195c",
      "name": "Generate Completion Notifications ",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        2192,
        1424
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "bbde4ebb-2f99-46b7-80da-b175fd41c234",
      "name": "Apply Notification Context Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        2272,
        1824
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "367cf36e-b61b-4133-a2f1-15f397a2c35f",
      "name": "LLM Engine for Notification Generation",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        2112,
        1760
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "9f869d09-9902-43f5-b5f5-367c2f01b0cf",
      "name": "Validate Notification Output JSON",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        2448,
        1776
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "ff0d9185-c760-4660-bccc-96a18e3c7402",
      "name": "Send Video Ready Slack Notification",
      "type": "n8n-nodes-base.slack",
      "position": [
        2720,
        1072
      ],
      "parameters": {},
      "typeVersion": 2.3
    },
    {
      "id": "a76efcd6-ac8b-4797-b219-33a9cb32f15a",
      "name": "Send Video Ready Email Notification",
      "type": "n8n-nodes-base.gmail",
      "position": [
        2752,
        1680
      ],
      "parameters": {},
      "typeVersion": 2.1
    },
    {
      "id": "f1cff981-dfd1-4688-915d-e74fdedd1102",
      "name": "Error Handler Trigger",
      "type": "n8n-nodes-base.errorTrigger",
      "position": [
        -1184,
        2496
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "3127b7db-2ec9-4fb7-b80f-a46a551b1b84",
      "name": "Slack: Send Error Alert",
      "type": "n8n-nodes-base.slack",
      "position": [
        -832,
        2496
      ],
      "parameters": {},
      "typeVersion": 2.3
    },
    {
      "id": "3fb84610-7b6d-45e8-be3d-4dd516cd32cd",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1264,
        2304
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "f7a00628-388c-4d73-957b-eddade85ce8d",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2128,
        384
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "d13fa04f-9c05-402c-8ef9-d017c3c6b701",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1360,
        960
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "4eff359f-e51d-4ec3-8900-9f61b0f65bbe",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -48,
        1024
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "6652f436-c07a-45aa-b87e-3aa5a711f118",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1520,
        1024
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "879c36a9-836d-4065-a5bc-d4a2c6f14647",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2048,
        864
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "364ae7db-a35c-43a8-bbf1-a7886aeeecf3",
  "connections": {
    "Error Handler Trigger": {
      "main": [
        [
          {
            "node": "Slack: Send Error Alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Receive Script Request ": {
      "main": [
        [
          {
            "node": "Parse Incoming Script Payload",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check HeyGen Video Status1": {
      "main": [
        [
          {
            "node": "Wait Before Rechecking Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Incoming Script Payload": {
      "main": [
        [
          {
            "node": "Rewrite & Structure Video Script ",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait Before Rechecking Status": {
      "main": [
        [
          {
            "node": "Evaluate Video Completion Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Generated HeyGen Video": {
      "main": [
        [
          {
            "node": "Upload Generated Video to Google Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "LLM Engine for Script Rewriting": {
      "ai_languageModel": [
        [
          {
            "node": "Rewrite & Structure Video Script ",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Evaluate Video Completion Status": {
      "main": [
        [
          {
            "node": "Download Generated HeyGen Video",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait Before Checking Video Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Apply Notification Context Memory": {
      "ai_memory": [
        [
          {
            "node": "Generate Completion Notifications ",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Rewrite & Structure Video Script ": {
      "main": [
        [
          {
            "node": "Submit Video Generation Request to HeyGen",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate Notification Output JSON": {
      "ai_outputParser": [
        [
          {
            "node": "Generate Completion Notifications ",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Validate Structured Script Output": {
      "ai_outputParser": [
        [
          {
            "node": "Rewrite & Structure Video Script ",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Wait Before Checking Video Status": {
      "main": [
        [
          {
            "node": "Check HeyGen Video Status1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Completion Notifications ": {
      "main": [
        [
          {
            "node": "Send Video Ready Email Notification",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send Video Ready Slack Notification",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Apply Script Writing Memory Context": {
      "ai_memory": [
        [
          {
            "node": "Rewrite & Structure Video Script ",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "LLM Engine for Notification Generation": {
      "ai_languageModel": [
        [
          {
            "node": "Generate Completion Notifications ",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Upload Generated Video to Google Drive": {
      "main": [
        [
          {
            "node": "Generate Completion Notifications ",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Submit Video Generation Request to HeyGen": {
      "main": [
        [
          {
            "node": "Wait Before Checking Video Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

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…

Source: https://n8n.io/workflows/11829/ — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

Enhance your support, onboarding, and internal knowledge workflows with an intelligent RAG-powered chatbot that responds using live data stored in Google Sheets. 🤖📚 Built for teams that rely on struct

Chat Trigger, Output Parser Structured, Memory Buffer Window +6
AI & RAG

🧠 Gwen – The AI Voice Marketing Agent Gwen is your intelligent voice-powered marketing assistant built in n8n. She combines the power of OpenAI, ElevenLabs, and automation workflows to handle content

Tool Workflow, Memory Buffer Window, Agent +10
AI & RAG

Public-facing professionals (developer advocates, founders, marketers, content creators) who get bombarded with LinkedIn messages that aren't actually for them - support requests when you're in market

Slack, HTTP Request, Agent +4
AI & RAG

This workflow automates enterprise resource planning (ERP) operations across Engineering, Finance, HR, and Admin departments for operations managers, ERP administrators, and business process owners wh

Agent, Gmail, Slack +6
AI & RAG

JoinDAn8n. Uses httpRequest, dataTable, emailReadImap, lmChatOpenAi. Webhook trigger; 37 nodes.

HTTP Request, Data Table, Email Read Imap +6