# Create script-to-video avatar videos with HeyGen: n8n workflow

> Started by another system calling it, and works across Gmail, Google Drive and Slack. It puts OpenAI behind a retrieval step, so answers are drawn from...

Source: https://millionrounds.com/workflow/create-script-to-video-avatar-videos-with-heygen (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [Content](https://millionrounds.com/workflows?category=Content#library)

# Create script-to-video avatar videos with HeyGen

Started by another system calling it, and works across Gmail, Google Drive and Slack. It puts OpenAI behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 21 steps, 1 branch, 2 loops or waits: large, and worth reading before you trust it with anything live.

Large Calls a model: OpenAI Retrieval

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fcreate-script-to-video-avatar-videos-with-heygen)

**21 steps** Large: read it before trusting it with anything live

**1** Branch: places the flow splits

**2** Loops or waits

**3** Services it connects to

## The flow

Starts it 2 Model 8 Logic 4 Service 7

The steps in the order they run, from what starts it.

- 1 **Receive Script Request** Webhook *Starts it*
- 2 **Apply Script Writing Memory Context** Memory Buffer Window *Model*
- 3 **LLM Engine for Script Rewriting** Lm Chat Open Ai *Model*
- 4 **Validate Structured Script Output** Output Parser Structured *Model*
- 5 **Apply Notification Context Memory** Memory Buffer Window *Model*
- 6 **LLM Engine for Notification Generation** Lm Chat Open Ai *Model*
- 7 **Validate Notification Output JSON** Output Parser Structured *Model*
- 8 **Error Handler Trigger** Error trigger *Starts it*
- 9 **Parse Incoming Script Payload** Code *Logic*
- 10 **Rewrite & Structure Video Script** Agent *Model*
- 11 **Generate Completion Notifications** Agent *Model*
- 12 **Slack: Send Error Alert** Slack *Service*
- 13 **Submit Video Generation Request to HeyGen** Http Request *Service*
- 14 **Send Video Ready Email Notification** Gmail *Service*
- 15 **Send Video Ready Slack Notification** Slack *Service*
- 16 **Wait Before Checking Video Status** Wait *Logic*
- 17 **Check HeyGen Video Status1** Http Request *Service*
- 18 **Wait Before Rechecking Status** Wait *Logic*
- 19 **Evaluate Video Completion Status** If *Logic*
- 20 **Download Generated HeyGen Video** Http Request *Service*
- 21 **Upload Generated Video to Google Drive** Google Drive *Service*

## How it's built

- **Starts on:** Another system calling it
- **Steps:** 21, with 1 branch, 2 loops or waits
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Gmail, Google Drive, Slack
- **Model:** OpenAI
- **Retrieval:** Answers are drawn from documents you supply, not from the model alone

## Questions

What does it need to run?

An n8n account, plus your own Gmail, Google Drive and Slack accounts, and a key for OpenAI. You connect your own accounts after importing it; none are included.

What starts it?

It starts on another system calling it.

Does it use AI?

Yes. It calls OpenAI. Its answers draw on documents you give it, not on the model alone. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Take your time. At 21 steps it is large: read it before trusting it with anything live.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

**Before you run it**

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 21 steps before you point it at anything that matters.

## Run it in n8n

- **Create your n8n account** Free to start. n8n is where the workflow runs. [Create an n8n account ↗](https://millionrounds.com/n8n)
- **Download the workflow** Free with a Millionrounds account. [Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fcreate-script-to-video-avatar-videos-with-heygen)
- **Paste it into n8n** Open a new workflow in n8n and paste. Then connect your own accounts.

Stored with the author's traces removed: canvas notes, instance identifiers, saved credential names and any live document they had left behind.

## Connects to

Each opens the other workflows that use it.

[Gmail](https://millionrounds.com/workflows?service=Gmail#library)[Google Drive](https://millionrounds.com/workflows?service=Google+Drive#library)[Slack](https://millionrounds.com/workflows?service=Slack#library)

## Workflows like it

Also content, with the same services where possible, closest in size first.

- [**AI-powered content analysis with Decodo and OpenAI** 21 steps · calls a model · Gmail, Google Docs](https://millionrounds.com/workflow/ai-powered-content-analysis-with-decodo-and-openai)
- [**Analyze YouTube videos with OpenAI** 21 steps · calls a model · Gmail, Google Sheets](https://millionrounds.com/workflow/analyze-youtube-videos-with-openai)
- [**Auto generate & post LinkedIn content for Amazon sellers** 21 steps · calls a model · Airtable, Google Drive](https://millionrounds.com/workflow/auto-generate-and-post-linkedin-content-for-amazon-sellers)
- [**Automate AI video creation & multi-platform publishing** 21 steps · calls a model · Google Drive, Google Sheets](https://millionrounds.com/workflow/automate-ai-video-creation-and-multi-platform-publishing)
- [**Create AI newsletters from YouTube with LangChain and Gemini** 21 steps · calls a model · Gmail, Google Sheets](https://millionrounds.com/workflow/create-ai-newsletters-from-youtube-with-langchain-and-gemini)
- [**Create LinkedIn posts and WordPress blogs with OpenAI** 21 steps · calls a model · Google Drive, Google Sheets](https://millionrounds.com/workflow/create-linkedin-posts-and-wordpress-blogs-with-openai)
