# Facebook ad library spy with OpenAI and Google Drive: 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/facebook-ad-library-spy-with-openai-and-google-drive (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)

# Facebook ad library spy with OpenAI and Google Drive

Started by an event in a connected app, and works across Google Drive and Google Sheets. It hands the judgement calls to OpenAI. 24 steps, 1 branch, 7 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%2Ffacebook-ad-library-spy-with-openai-and-google-drive)

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

**1** Branch: places the flow splits

**7** Loops or waits

**2** Services it connects to

## The flow

Starts it 1 Model 4 Logic 9 Service 10

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

- 1 **When clicking ‘Execute workflow’** Manual trigger *Starts it*
- 2 **Run Ad Library Scraper** Http Request *Service*
- 3 **Filter For Likes** Filter *Logic*
- 4 **Switch** Switch *Logic*
- 5 **Loop Over Video Ads** Split In Batches *Logic*
- 6 **Loop Over Image Ads** Split In Batches *Logic*
- 7 **Loop Over Text Ads** Split In Batches *Logic*
- 8 **Download Video** Http Request *Service*
- 9 **Analyze Image** Open Ai *Model*
- 10 **Output Text Summary** Open Ai *Model*
- 11 **Upload Video to Drive** Google Drive *Service*
- 12 **Output Image Summary** Open Ai *Model*
- 13 **Add as Type = Text** Google Sheets *Service*
- 14 **Begin Gemini Upload Session** Http Request *Service*
- 15 **Add as Type = Image** Google Sheets *Service*
- 16 **Wait** Wait *Logic*
- 17 **Redownload Video** Google Drive *Service*
- 18 **Wait1** Wait *Logic*
- 19 **Upload Video to Gemini** Http Request *Service*
- 20 **Wait3** Wait *Logic*
- 21 **Analyze Video with Gemini** Http Request *Service*
- 22 **Output Video Summary** Open Ai *Model*
- 23 **Add as Type = Video** Google Sheets *Service*
- 24 **Wait2** Wait *Logic*

## How it's built

- **Starts on:** An event in a connected app
- **Steps:** 24, with 1 branch, 7 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 24 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 24 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%2Ffacebook-ad-library-spy-with-openai-and-google-drive)
- **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 data collection, with the same services where possible, closest in size first.

- [**AI Facebook ad spy tool with Apify and OpenAI** 24 steps · calls a model · Google Drive, Google Sheets](https://millionrounds.com/workflow/ai-facebook-ad-spy-tool-with-apify-and-openai)
- [**AI-powered visual regression testing with Gemini and Linear** 24 steps · calls a model · Google Drive, Google Sheets](https://millionrounds.com/workflow/ai-powered-visual-regression-testing-with-gemini-and-linear)
- [**Analyze commodity portfolio diversification with Sheets** 24 steps · calls a model · Gmail, Google Sheets](https://millionrounds.com/workflow/analyze-commodity-portfolio-diversification-with-sheets)
- [**Detect visual regressions with Apify and Gemini** 24 steps · calls a model · Google Drive, Google Sheets](https://millionrounds.com/workflow/detect-visual-regressions-with-apify-and-gemini)
- [**From Google Drive to Instagram, TikTok & YouTube with Airtable** 24 steps · calls a model · Airtable, Google Drive](https://millionrounds.com/workflow/from-google-drive-to-instagram-tiktok-and-youtube-with-airta)
- [**Send regulatory update digest emails with Google Sheets** 24 steps · calls a model · Email, Excel](https://millionrounds.com/workflow/send-regulatory-update-digest-emails-with-google-sheets)
