# Detect viral YouTube videos with OpenAI and Gmail: n8n workflow

> Started by a clock, and works across Gmail. It hands the judgement calls to OpenAI. 22 steps: large, and worth reading before you trust it with anything live.

Source: https://millionrounds.com/workflow/detect-viral-youtube-videos-with-openai-and-gmail (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)

# Detect viral YouTube videos with OpenAI and Gmail

Started by a clock, and works across Gmail. It hands the judgement calls to OpenAI. 22 steps: 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%2Fdetect-viral-youtube-videos-with-openai-and-gmail)

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

**0** Branches: places the flow splits

**0** Loops or waits

**1** Service it connects to

## The flow

Starts it 2 Model 3 Logic 13 Service 4

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

- 1 **When clicking ‘Test workflow’** Manual trigger *Starts it*
- 2 **Think** Tool Think *Model*
- 3 **OpenAI Chat Model** Lm Chat Open Ai *Model*
- 4 **Schedule Trigger** Schedule trigger *Starts it*
- 5 **Setup** Set *Logic*
- 6 **AI Agent** Agent *Model*
- 7 **SearchVideos** Http Request *Service*
- 8 **Markdown** Markdown *Logic*
- 9 **Split Out1** Split Out *Logic*
- 10 **Send_Report** Gmail *Service*
- 11 **Split Out2** Split Out *Logic*
- 12 **GetChannelInfo** Http Request *Service*
- 13 **GetVidStats** Http Request *Service*
- 14 **ChannelInfo** Code *Logic*
- 15 **VidStats** Code *Logic*
- 16 **Merge** Merge *Logic*
- 17 **Remove_Duplicates** Remove Duplicates *Logic*
- 18 **CalculateMetrics** Code *Logic*
- 19 **AlgorithmicLiftScore** Code *Logic*
- 20 **Sort** Sort *Logic*
- 21 **Limit** Limit *Logic*
- 22 **Aggregate** Aggregate *Logic*

## How it's built

- **Starts on:** A clock
- **Steps:** 22
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Gmail
- **Model:** OpenAI

## Questions

What does it need to run?

An n8n account, plus your own Gmail account, 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 22 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 22 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%2Fdetect-viral-youtube-videos-with-openai-and-gmail)
- **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)

## Workflows like it

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

- [**English lesson generator from podcasts with RSS and OpenAI** 22 steps · calls a model · Gmail, RSS](https://millionrounds.com/workflow/english-lesson-generator-from-podcasts-with-rss-and-openai)
- [**Extract video metadata & auto-upload to YouTube with OpenAI** 22 steps · calls a model · Gmail, Google Sheets](https://millionrounds.com/workflow/extract-video-metadata-and-auto-upload-to-youtube-with-opena)
- [**Generate Gmail reply drafts with OpenAI and Postgres** 22 steps · calls a model · Gmail, Postgres](https://millionrounds.com/workflow/generate-gmail-reply-drafts-with-openai-and-postgres)
- [**Generate real-estate marketing images and videos with OpenAI** 22 steps · calls a model · Gmail, Google Drive](https://millionrounds.com/workflow/generate-real-estate-marketing-images-and-videos-with-openai)
- [**Refined post generator with Gmail** 22 steps · calls a model · Gmail, Google Sheets](https://millionrounds.com/workflow/refined-post-generator-with-gmail)
- [**Transcribe long audio files beyond 25MB limit with FileFlows** 22 steps · calls a model · Gmail](https://millionrounds.com/workflow/transcribe-long-audio-files-beyond-25mb-limit-with-fileflows)
