# AI-powered Meta ads analysis & creation with Gemini: n8n workflow

> Started by an event in a connected app, and works across Google Drive and Google Sheets. It hands the judgement calls to OpenAI.

Source: https://millionrounds.com/workflow/ai-powered-meta-ads-analysis-and-creation-with-gemini (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [Research and reporting](https://millionrounds.com/workflows?category=Research+and+reporting#library)

# AI-powered Meta ads analysis & creation with Gemini

Started by an event in a connected app, and works across Google Drive and Google Sheets. It hands the judgement calls to OpenAI. 49 steps, 4 branches, 3 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%2Fai-powered-meta-ads-analysis-and-creation-with-gemini)

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

**4** Branches: places the flow splits

**3** Loops or waits

**2** Services it connects to

## The flow

Starts it 2 Model 6 Logic 11 Service 30

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

- 1 **OpenAI Chat Model** Lm Chat Open Ai *Model*
- 2 **Structured Output Parser** Output Parser Structured *Model*
- 3 **OpenAI Chat Model1** Lm Chat Open Ai *Model*
- 4 **Structured Output Parser1** Output Parser Structured *Model*
- 5 **When clicking ‘Test workflow’** Manual trigger *Starts it*
- 6 **Google Drive Folder Updated** Google Drive trigger *Starts it*
- 7 **AI Agent** Agent *Model*
- 8 **AI Agent1** Agent *Model*
- 9 **Get Ads to Process** Google Sheets *Service*
- 10 **Get Settings** Google Sheets *Service*
- 11 **Fetch All Files** Google Drive *Service*
- 12 **Save Video Analysis Output** Google Sheets *Service*
- 13 **Save Image Analysis Output** Google Sheets *Service*
- 14 **Filter Unprocessed Ads** Filter *Logic*
- 15 **Merge** Merge *Logic*
- 16 **Get Files Metadata** Http Request *Service*
- 17 **Video or Image Asset** Switch *Logic*
- 18 **Extract File Specs** Set *Logic*
- 19 **Get Video** Http Request *Service*
- 20 **Get image 1** Http Request *Service*
- 21 **Create Asset** Google Sheets *Service*
- 22 **Upload Ad Video** Facebook Graph Api *Service*
- 23 **Upload Ad Image** Facebook Graph Api *Service*
- 24 **Get All Rows** Google Sheets *Service*
- 25 **Wait** Wait *Logic*
- 26 **Check if two or one image** If *Logic*
- 27 **AI Description is Empty** Filter *Logic*
- 28 **Get Video Preview Image** Facebook Graph Api *Service*
- 29 **Get image** Http Request *Service*
- 30 **Create Image Creative** Facebook Graph Api *Service*
- 31 **Get File Metadata** Http Request *Service*
- 32 **Create Video Ad Creative** Facebook Graph Api *Service*
- 33 **Upload Second Ad Image** Facebook Graph Api *Service*
- 34 **Create Image Ad** Facebook Graph Api *Service*
- 35 **Video or Image** Switch *Logic*
- 36 **Create Video Ad** Facebook Graph Api *Service*
- 37 **Create Multiple Image Creative** Facebook Graph Api *Service*
- 38 **Facebook Graph API** Facebook Graph Api *Service*
- 39 **Gemini - Generate Upload URL** Http Request *Service*
- 40 **Google Drive** Google Drive *Service*
- 41 **Save Video Ad Details** Google Sheets *Service*
- 42 **Save Image Ad Details** Google Sheets *Service*
- 43 **Download from Google Drive** Google Drive *Service*
- 44 **Gemini - Upload File** Http Request *Service*
- 45 **Wait 3 Seconds** Wait *Logic*
- 46 **Check State** Http Request *Service*
- 47 **If** If *Logic*
- 48 **Analyze Video with Gemini** Http Request *Service*
- 49 **Wait 2 Seconds** Wait *Logic*

## How it's built

- **Starts on:** An event in a connected app
- **Steps:** 49, with 4 branches, 3 loops or waits
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Google Drive, Google Sheets
- **Model:** OpenAI

## Questions

What does it need to run?

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

What starts it?

It starts on an event in a connected app.

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 49 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 49 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%2Fai-powered-meta-ads-analysis-and-creation-with-gemini)
- **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.

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

## Workflows like it

Also research and reporting, with the same services where possible, closest in size first.

- [**Automated Google Business reports with OpenAI** 56 steps · calls a model · Gmail, Google Business Profile](https://millionrounds.com/workflow/automated-google-business-reports-with-openai)
- [**Business AI command center: Modular agents** 58 steps · calls a model · Gmail, Google Drive](https://millionrounds.com/workflow/business-ai-command-center-modular-agents)
- [**Analyze Google Ads competitors with OpenRouter and OpenAI** 39 steps · calls a model · Gmail, Google Sheets](https://millionrounds.com/workflow/analyze-google-ads-competitors-with-openrouter-and-openai)
- [**Customer feedback analysis with HTML** 34 steps · calls a model · Gmail, Google Sheets](https://millionrounds.com/workflow/customer-feedback-analysis-with-html)
- [**Draft and manage academic research papers with OpenAI** 34 steps · calls a model · Google Sheets, in-memory vectors](https://millionrounds.com/workflow/draft-and-manage-academic-research-papers-with-openai)
- [**Weekly stock/ETF analysis with Claude and Gmail** 33 steps · Gmail, Google Sheets](https://millionrounds.com/workflow/weekly-stock-etf-analysis-with-claude-and-gmail)
