Automation library · Content

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.

LargeCalls a model: OpenAIRetrieval

21 stepsLarge: read it before trusting it with anything live
1Branch: places the flow splits
2Loops or waits
3Services it connects to

The flow

Starts it 2Model 8Logic 4Service 7

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

  1. 1Receive Script Request WebhookStarts it
  2. 2Apply Script Writing Memory ContextMemory Buffer WindowModel
  3. 3LLM Engine for Script RewritingLm Chat Open AiModel
  4. 4Validate Structured Script OutputOutput Parser StructuredModel
  5. 5Apply Notification Context MemoryMemory Buffer WindowModel
  6. 6LLM Engine for Notification GenerationLm Chat Open AiModel
  7. 7Validate Notification Output JSONOutput Parser StructuredModel
  8. 8Error Handler TriggerError triggerStarts it
  9. 9Parse Incoming Script PayloadCodeLogic
  10. 10Rewrite & Structure Video Script AgentModel
  11. 11Generate Completion Notifications AgentModel
  12. 12Slack: Send Error AlertSlackService
  13. 13Submit Video Generation Request to HeyGenHttp RequestService
  14. 14Send Video Ready Email NotificationGmailService
  15. 15Send Video Ready Slack NotificationSlackService
  16. 16Wait Before Checking Video StatusWaitLogic
  17. 17Check HeyGen Video Status1Http RequestService
  18. 18Wait Before Rechecking StatusWaitLogic
  19. 19Evaluate Video Completion StatusIfLogic
  20. 20Download Generated HeyGen VideoHttp RequestService
  21. 21Upload Generated Video to Google DriveGoogle DriveService

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.