# Analyze competitor Facebook ads with Apify and OpenAI: n8n workflow

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

Source: https://millionrounds.com/workflow/analyze-competitor-facebook-ads-with-apify-and-openai (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)

# Analyze competitor Facebook ads with Apify and OpenAI

Started by an event in a connected app, and works across Google Sheets. It hands the judgement calls to OpenAI. 22 steps, 1 branch, 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%2Fanalyze-competitor-facebook-ads-with-apify-and-openai)

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

**1** Branch: places the flow splits

**3** Loops or waits

**1** Service it connects to

## The flow

Starts it 1 Model 11 Logic 6 Service 4

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

- 1 **Start Manually** Manual trigger *Starts it*
- 2 **Video Analysis Model** Lm Chat Open Ai *Model*
- 3 **Video Analysis Output Format** Output Parser Structured *Model*
- 4 **Image Analysis Model** Lm Chat Open Ai *Model*
- 5 **Image Analysis Output Format** Output Parser Structured *Model*
- 6 **Text Analysis Model** Lm Chat Open Ai *Model*
- 7 **Text Analysis Output Format** Output Parser Structured *Model*
- 8 **Configuration** Set *Logic*
- 9 **Generate Video Ad Intelligence** Agent *Model*
- 10 **Generate Image Ad Intelligence** Agent *Model*
- 11 **Generate Text Ad Intelligence** Agent *Model*
- 12 **Scrape Facebook Ad Library with Apify** Http Request *Service*
- 13 **Save Video Ad Analysis** Google Sheets *Service*
- 14 **Save Image Ad Analysis** Google Sheets *Service*
- 15 **Save Text Ad Analysis** Google Sheets *Service*
- 16 **Filter High-Engagement Advertisers** Filter *Logic*
- 17 **Loop Over Video Ads** Split In Batches *Logic*
- 18 **Loop Over Image Ads** Split In Batches *Logic*
- 19 **Loop Over Text Ads** Split In Batches *Logic*
- 20 **Route by Ad Content Type** Switch *Logic*
- 21 **Analyze Video Preview Image (GPT Vision)** Open Ai *Model*
- 22 **Analyze Image Ad (GPT Vision)** Open Ai *Model*

## How it's built

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

## Questions

What does it need to run?

An n8n account, plus your own Google Sheets account, 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 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%2Fanalyze-competitor-facebook-ads-with-apify-and-openai)
- **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 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.

- [**AI-powered viral trend analysis for TikTok and Instagram** 22 steps · calls a model · Gmail, Google Sheets](https://millionrounds.com/workflow/ai-powered-viral-trend-analysis-for-tiktok-and-instagram)
- [**CryptoMind AI: Multi-Model Market Analyst with Gemini** 22 steps · calls a model · Google Sheets, RSS](https://millionrounds.com/workflow/cryptomind-ai-multi-model-market-analyst-with-gemini)
- [**AI-powered vulnerability scanner with Nessus and Google Sheets** 22 steps · Email, Google Sheets](https://millionrounds.com/workflow/ai-powered-vulnerability-scanner-with-nessus-and-google-shee)
- [**Automate fundamental stock analysis with Google Sheets DCF** 22 steps · Google Sheets](https://millionrounds.com/workflow/automate-fundamental-stock-analysis-with-google-sheets-dcf)
- [**Token Estim8r UI – visualize token usage analytics dashboard** 22 steps · Google Sheets](https://millionrounds.com/workflow/token-estim8r-ui-visualize-token-usage-analytics-dashboard)
- [**Automate LinkedIn engagement with OpenRouter and Google Sheets** 23 steps · calls a model · Google Sheets, Telegram](https://millionrounds.com/workflow/automate-linkedin-engagement-with-openrouter-and-google-shee)
