Automation library · Content

Meta ads video analysis - Apify - Gemini - GDrive - GSheet

Started by an event in a connected app, and works across Google Drive and Google Sheets. It hands the judgement calls to Gemini. 25 steps, 1 branch, 2 loops or waits: large, and worth reading before you trust it with anything live.

LargeCalls a model: Gemini

25 stepsLarge: read it before trusting it with anything live
1Branch: places the flow splits
2Loops or waits
2Services it connects to

The flow

Starts it 1Model 3Logic 12Service 9

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

  1. 1When clicking ‘Test workflow’Manual triggerStarts it
  2. 2Google Gemini Chat ModelLm Chat Google GeminiModel
  3. 3Structured Output ParserOutput Parser StructuredModel
  4. 4SettingsSetLogic
  5. 5Structured Output Parsing AgentAgentModel
  6. 6Clean PromptCodeLogic
  7. 7Store DataGoogle SheetsService
  8. 8Scrape Meta Ad Library with ApifyHttp RequestService
  9. 9Loop Over ItemsSplit In BatchesLogic
  10. 10Calculate Runtime in DaysSetLogic
  11. 11Download FileHttp RequestService
  12. 12Sort by Reach or Days RunningSortLogic
  13. 13Change Filetype to VideoCodeLogic
  14. 14Filter only Video AdsFilterLogic
  15. 15Save to Google DriveGoogle DriveService
  16. 16Limit Videos to AnalyzeLimitLogic
  17. 17Gemini - Generate Upload URLHttp RequestService
  18. 18Pass relevant FieldsSetLogic
  19. 19Download from Google DriveGoogle DriveService
  20. 20Gemini - Upload FileHttp RequestService
  21. 21Wait for Upload ProcessingWaitLogic
  22. 22Edit FieldsSetLogic
  23. 23Get File StatusHttp RequestService
  24. 24IfIfLogic
  25. 25Analyze Video with GeminiHttp RequestService

How it's built

Starts on
An event in a connected app
Steps
25, with 1 branch, 2 loops or waits
Size
Large: read it before trusting it with anything live
Connects to
Google Drive, Google Sheets
Model
Gemini

Questions

What does it need to run?

An n8n account, plus your own Google Drive and Google Sheets accounts, and a key for Gemini. 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 Gemini. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Take your time. At 25 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 25 steps before you point it at anything that matters.