# Create AI videos with HeyGen: n8n workflow template

> Started by another system calling it, and works across Baserow. It hands the judgement calls to OpenAI.

Source: https://millionrounds.com/workflow/create-ai-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 AI videos with HeyGen

Started by another system calling it, and works across Baserow. It hands the judgement calls to OpenAI. 59 steps, 9 branches, 6 loops or waits: large, and worth reading before you trust it with anything live.

Large Calls a model: OpenAI

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

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

**9** Branches: places the flow splits

**6** Loops or waits

**1** Service it connects to

## The flow

Starts it 2 Model 5 Logic 37 Service 15

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

- 1 **Structured Output Parser** Output Parser Structured *Model*
- 2 **OpenAI Chat Model** Lm Chat Open Ai *Model*
- 3 **Webhook** Webhook *Starts it*
- 4 **OpenAI Chat Model1** Lm Chat Open Ai *Model*
- 5 **When Executed by Another Workflow** Execute Workflow trigger *Starts it*
- 6 **Basic LLM Chain** Chain Llm *Model*
- 7 **Basic LLM Chain Manual** Chain Llm *Model*
- 8 **Body** Set *Logic*
- 9 **Baserow Error** Baserow *Service*
- 10 **Scenes Mapping** Set *Logic*
- 11 **Update Script** Baserow *Service*
- 12 **Execute Workflow4** Execute Workflow *Logic*
- 13 **Should Process?** If *Logic*
- 14 **Stop and Error** Stop And Error *Logic*
- 15 **Split Out** Split Out *Logic*
- 16 **Switch ScriptType** Switch *Logic*
- 17 **Baserow Processing** Baserow *Service*
- 18 **loop_over_scenes** Split In Batches *Logic*
- 19 **If** If *Logic*
- 20 **If_with_avatar** If *Logic*
- 21 **Leo - Improve Prompt** Http Request *Service*
- 22 **Execute Workflow** Execute Workflow *Logic*
- 23 **Aggregate** Aggregate *Logic*
- 24 **Code** Code *Logic*
- 25 **Leo - Generate Image** Http Request *Service*
- 26 **Execute Workflow5** Execute Workflow *Logic*
- 27 **CaptionsAI1** Http Request *Service*
- 28 **If_with_heygen** If *Logic*
- 29 **Wait1** Wait *Logic*
- 30 **Execute Workflow3** Execute Workflow *Logic*
- 31 **Wait6** Wait *Logic*
- 32 **CAPTIONS Execute ERROR1** Execute Workflow *Logic*
- 33 **HeyGen** Http Request *Service*
- 34 **json2video: Video Rendering** Http Request *Service*
- 35 **Leo - Get imageId** Http Request *Service*
- 36 **CaptionsAI: Check Poll1** Http Request *Service*
- 37 **Wait4** Wait *Logic*
- 38 **heygen Execute ERROR** Execute Workflow *Logic*
- 39 **Wait** Wait *Logic*
- 40 **json2video Execute ERROR** Execute Workflow *Logic*
- 41 **BackgroundType** If *Logic*
- 42 **cap_response** Switch *Logic*
- 43 **HeyGen: Check Video** Http Request *Service*
- 44 **json2video: Check Video Rendering** Http Request *Service*
- 45 **Runway - Create Video** Http Request *Service*
- 46 **output image** Set *Logic*
- 47 **Code Add Sub** Code *Logic*
- 48 **CAPTIONS Execute ERROR** Execute Workflow *Logic*
- 49 **heygen_response** Switch *Logic*
- 50 **heygen Execute ERROR2** Execute Workflow *Logic*
- 51 **j2v_response** Switch *Logic*
- 52 **Wait2** Wait *Logic*
- 53 **Execute Workflow2** Execute Workflow *Logic*
- 54 **Code Heygen** Code *Logic*
- 55 **Baserow** Baserow *Service*
- 56 **json2video Execute ERROR1** Execute Workflow *Logic*
- 57 **Runway - Get Video** Http Request *Service*
- 58 **output** Set *Logic*
- 59 **Execute Workflow6** Execute Workflow *Logic*

## How it's built

- **Starts on:** Another system calling it
- **Steps:** 59, with 9 branches, 6 loops or waits
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Baserow
- **Model:** OpenAI

## Questions

What does it need to run?

An n8n account, plus your own Baserow account, 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. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Take your time. At 59 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 59 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-ai-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.

[Baserow](https://millionrounds.com/workflows?service=Baserow#library)

## Workflows like it

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

- [**Create AI videos with OpenAI and HeyGen** 59 steps · calls a model · Baserow](https://millionrounds.com/workflow/create-ai-videos-with-openai-and-heygen)
- [**Auto-comment on Reddit posts with Baserow** 21 steps · calls a model · Baserow, Reddit](https://millionrounds.com/workflow/auto-comment-on-reddit-posts-with-baserow)
