# Automate viral video generation with Shotstack, OpenAI, and S3: n8n workflow

> Started by a clock, and works across S3, Supabase and YouTube. It hands the judgement calls to OpenAI.

Source: https://millionrounds.com/workflow/automacao-gerar-videos-virais-shotstack-with-openai-and-s3 (Millionrounds; every figure on the page links to its filing or article)

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

# Automate viral video generation with Shotstack, OpenAI, and S3

Started by a clock, and works across S3, Supabase and YouTube. It hands the judgement calls to OpenAI. 30 steps, 1 branch, 2 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%2Fautomacao-gerar-videos-virais-shotstack-with-openai-and-s3)

**30 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 1 Model 7 Logic 10 Service 12

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

- 1 **Schedule Trigger** Schedule trigger *Starts it*
- 2 **OpenAI Chat Model** Lm Chat Open Ai *Model*
- 3 **Pega ID** Set *Logic*
- 4 **Gerar Ideia** Agent *Model*
- 5 **Gerar Script** Agent *Model*
- 6 **AI Agent** Agent *Model*
- 7 **Gera imagens** Agent *Model*
- 8 **Narracao** Http Request *Service*
- 9 **Code** Code *Logic*
- 10 **Separa prompts Imagens** Code *Logic*
- 11 **OpenAI** Open Ai *Model*
- 12 **Salvar dados do vídeo** Supabase *Service*
- 13 **Split Out** Split Out *Logic*
- 14 **Extrair audio** Extract From File *Service*
- 15 **Loop Over Items** Split In Batches *Logic*
- 16 **converte MP3** Code *Logic*
- 17 **Code1** Code *Logic*
- 18 **Gera imagem** Open Ai *Model*
- 19 **S3** S3 *Service*
- 20 **Code3** Code *Logic*
- 21 **Supabase GPT** Supabase *Service*
- 22 **Salva Narração** Supabase *Service*
- 23 **HTTP Request** Http Request *Service*
- 24 **Aguarda 20s** Wait *Logic*
- 25 **Verifica Status** Http Request *Service*
- 26 **If** If *Logic*
- 27 **Pega Dados Postar** Supabase *Service*
- 28 **PegaUrlVideoPronto** Http Request *Service*
- 29 **Supabase** Supabase *Service*
- 30 **YouTube** You Tube *Service*

## How it's built

- **Starts on:** A clock
- **Steps:** 30, with 1 branch, 2 loops or waits
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** S3, Supabase, YouTube
- **Model:** OpenAI

## Questions

What does it need to run?

An n8n account, plus your own S3, Supabase and YouTube accounts, and a key for OpenAI. You connect your own accounts after importing it; none are included.

What starts it?

It starts on a clock.

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 30 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 30 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%2Fautomacao-gerar-videos-virais-shotstack-with-openai-and-s3)
- **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.

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

## Workflows like it

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

- [**Autonomous AI crawler with OpenAI and Supabase** 28 steps · calls a model · Supabase](https://millionrounds.com/workflow/autonomous-ai-crawler-with-openai-and-supabase)
- [**Google Drive to Pinecone vector storage workflow with OpenAI** 32 steps · calls a model · Google Drive, Supabase](https://millionrounds.com/workflow/google-drive-to-pinecone-vector-storage-workflow-with-openai)
- [**Automated email responses with OpenAI and Supabase** 27 steps · calls a model · Outlook, Postgres](https://millionrounds.com/workflow/automated-email-responses-with-openai-and-supabase)
- [**Generate AI YouTube shorts with Claude and Gemini** 27 steps · calls a model · Google Drive, Google Sheets](https://millionrounds.com/workflow/generate-ai-youtube-shorts-with-claude-and-gemini)
- [**Create a self-updating RAG chatbot with Google Drive** 34 steps · calls a model · Google Drive, Postgres](https://millionrounds.com/workflow/create-a-self-updating-rag-chatbot-with-google-drive)
- [**Websites into a conversational knowledge base with OpenAI RAG** 34 steps · calls a model · Supabase, Supabase vectors](https://millionrounds.com/workflow/websites-into-a-conversational-knowledge-base-with-openai-ra)
