Meta Ad Library to Google Sheets, smarter ad insights
You find a “great” Meta ad, save the link, and swear you’ll break it down later. Then later never comes, the ad disappears, and your swipe file turns into a graveyard of half-notes and random screenshots.
This hits performance marketers hard, but agency owners and in-house growth leads feel it too. With this Meta ads automation, you stop re-watching the same videos and re-writing the same takeaways, and you finally get structured insights you can compare.
Below is what the workflow does, what you get out of it, and how to plug it into your own research routine without making your process more complicated.
How This Automation Works
The full n8n workflow, from trigger to final output:
n8n Workflow Template: Meta Ad Library to Google Sheets, smarter ad insights
flowchart LR
subgraph sg0["When clicking ‘Test workflow’ Flow"]
direction LR
n0@{ icon: "mdi:play-circle", form: "rounded", label: "When clicking ‘Test workflow’", pos: "b", h: 48 }
n1@{ icon: "mdi:swap-vertical", form: "rounded", label: "Settings", pos: "b", h: 48 }
n2@{ icon: "mdi:swap-vertical", form: "rounded", label: "Loop Over Items", pos: "b", h: 48 }
n3@{ icon: "mdi:brain", form: "rounded", label: "Google Gemini Chat Model", pos: "b", h: 48 }
n4["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>Clean Prompt"]
n5@{ icon: "mdi:database", form: "rounded", label: "Store Data", pos: "b", h: 48 }
n6@{ icon: "mdi:robot", form: "rounded", label: "Structured Output Parsing Ag..", pos: "b", h: 48 }
n7@{ icon: "mdi:cog", form: "rounded", label: "Wait for Upload Processing", pos: "b", h: 48 }
n8@{ icon: "mdi:swap-vertical", form: "rounded", label: "Pass Values for Gemini", pos: "b", h: 48 }
n9["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>Upload Video to Gemini"]
n10["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>Analyze Video with Gemini"]
n11["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>Download File"]
n12["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>Change Filetype to Video"]
n13["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>Scrape Meta Ad Library with .."]
n14@{ icon: "mdi:swap-vertical", form: "rounded", label: "Pass relevant Fields", pos: "b", h: 48 }
n15@{ icon: "mdi:robot", form: "rounded", label: "Structured Output Parser", pos: "b", h: 48 }
n16@{ icon: "mdi:swap-vertical", form: "rounded", label: "Calculate Runtime in Days", pos: "b", h: 48 }
n17@{ icon: "mdi:cog", form: "rounded", label: "Sort by Reach or Days Running", pos: "b", h: 48 }
n18@{ icon: "mdi:swap-horizontal", form: "rounded", label: "Filter only Video Ads", pos: "b", h: 48 }
n19@{ icon: "mdi:cog", form: "rounded", label: "Limit Videos to Analyze", pos: "b", h: 48 }
n1 --> n4
n5 --> n2
n4 --> n13
n11 --> n12
n2 --> n11
n14 --> n2
n18 --> n19
n8 --> n7
n9 --> n8
n19 --> n14
n12 --> n9
n3 -.-> n6
n15 -.-> n6
n10 --> n6
n16 --> n17
n7 --> n10
n17 --> n18
n6 --> n5
n13 --> n16
n0 --> n1
end
%% Styling
classDef trigger fill:#e8f5e9,stroke:#388e3c,stroke-width:2px
classDef ai fill:#e3f2fd,stroke:#1976d2,stroke-width:2px
classDef aiModel fill:#e8eaf6,stroke:#3f51b5,stroke-width:2px
classDef decision fill:#fff8e1,stroke:#f9a825,stroke-width:2px
classDef database fill:#fce4ec,stroke:#c2185b,stroke-width:2px
classDef api fill:#fff3e0,stroke:#e65100,stroke-width:2px
classDef code fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
classDef disabled stroke-dasharray: 5 5,opacity: 0.5
class n0 trigger
class n6,n15 ai
class n3 aiModel
class n18 decision
class n5 database
class n9,n10,n11,n13 api
class n4,n12 code
classDef customIcon fill:none,stroke:none
class n4,n9,n10,n11,n12,n13 customIcon
The Problem: Ad Research Is Messy, Slow, and Hard to Reuse
Meta Ad Library research usually starts with good intentions and ends with tabs. Lots of tabs. You watch a few ads, copy a link into a doc, maybe paste a transcript snippet, then move on because you need to ship a campaign today, not build a research database. A week later, you can’t remember why you saved that ad, what the hook was, or whether it’s even relevant to your offer. And when you do try to compare ads, nothing is standardized, so you’re basically “vibing” your way through decisions.
It adds up fast. Here’s where it breaks down.
- You spend about 10 minutes per ad just to capture notes, and the notes still don’t match between teammates.
- High-performing ads get missed because you can’t sort by anything meaningful like reach, runtime, or creative pattern.
- Transcripts, hooks, and angles stay trapped in someone’s brain (or worse, in Slack messages).
- When you want to brief new creatives, you’re rebuilding the same swipe file from scratch.
The Solution: Meta Ad Library Videos → Gemini Insights → Google Sheets
This workflow turns ad “watching” into ad “processing.” You start by providing a Meta Ad Library source (typically a page ID or Ad Library URL), then n8n pulls down a batch of ads, ranks them, and keeps only video ads so you’re not wasting time on formats you don’t care about. For each video, it retrieves the media, uploads it to Google Gemini, waits for the upload to finish processing, and then requests a structured analysis. Gemini produces consistent fields like hook, transcript, format, concept, and narrative structure, then an AI agent parses that output into clean columns. Finally, everything lands in Google Sheets, ready to sort, filter, and turn into briefs.
The workflow starts with a manual trigger, so you run it when you want fresh intel. It then fetches ads, ranks them by reach or duration, analyzes each video with Gemini, and writes standardized insights into a single sheet. No copy-paste sessions required.
What You Get: Automation vs. Results
| What This Workflow Automates | Results You’ll Get |
|---|---|
|
|
Example: What This Looks Like
Say you review 20 competitor video ads every Monday. Manually, if you spend about 10 minutes per ad to find it, watch it, jot the hook, summarize the angle, and paste a link, that’s roughly 3 hours. With this workflow, you kick off the run in about 5 minutes, then let it process while you do something else. You come back to a Google Sheet with 20 rows of standardized insights, which usually means you’re “done” with research in under 30 minutes of real effort.
What You’ll Need
- n8n instance (try n8n Cloud free)
- Self-hosting option if you prefer (Hostinger works well)
- Google Sheets for storing the swipe file output.
- Google Gemini to analyze video creative and extract insights.
- Apify API key (get it from your Apify account settings).
Skill level: Intermediate. You’ll connect a few accounts, set an Ad Library source, and map sheet columns once.
Don’t want to set this up yourself? Talk to an automation expert (free 15-minute consultation).
How It Works
You trigger a new research run. In the template, it’s a manual start, which is perfect for weekly “research sprints” or pre-launch competitor scans.
The workflow pulls and cleans the ad list. It fetches Ad Library data via HTTP, computes basic metadata, ranks ads by reach or duration, then filters down to video-only so the AI is analyzing the right assets.
Each video gets analyzed in a consistent way. n8n processes ads in batches, retrieves the media file, uploads it to Gemini, waits for processing, and then requests a structured analysis (hook, transcript, format, concept, narrative structure, and any other fields you choose to prompt for).
Your swipe file updates itself. The AI agent parses everything into standardized fields and writes clean rows to Google Sheets, which means your team can filter, tag, and compare without reformatting anything.
You can easily modify the analysis fields to match your creative strategy, so you’re not stuck with generic outputs. See the full implementation guide below for customization options.
Step-by-Step Implementation Guide
Step 1: Configure the Manual Trigger
Start the workflow with the manual trigger and set the initial defaults for the run.
- Add the Manual Start Trigger node as the workflow trigger.
- Connect Manual Start Trigger to Configure Defaults.
- In Configure Defaults, define any starting fields your workflow relies on (e.g., API parameters, prompt settings, or limits).
- Link Configure Defaults to Refine Prompt Text to prepare the analysis prompt.
Step 2: Connect Ad Library Retrieval and Ranking
Fetch ads, compute runtime, and rank them before filtering to video-only assets.
- In Refine Prompt Text, customize the prompt transformation logic as needed.
- Configure Fetch Ad Library Data with the correct API endpoint, headers, and query parameters.
- Connect Fetch Ad Library Data to Compute Runtime Days to calculate the active days for each ad.
- Send output to Rank by Reach or Duration to sort results by performance.
- Filter results with Keep Video Ads Only to ensure only video ads proceed.
Step 3: Cap, Map, and Batch the Video Items
Limit the number of video ads, map fields for downstream processing, and iterate through each item.
- Set Cap Videos for Review to constrain how many videos are analyzed per run.
- Map required fields in Map Key Fields (e.g., media URL, ad ID, caption text).
- Connect Map Key Fields to Iterate Batch Items so each video is processed one at a time.
- Ensure Iterate Batch Items routes its batch output to Retrieve Media File.
Step 4: Retrieve and Upload Media for Gemini Processing
Download the video, convert it as needed, and upload it to Gemini for analysis.
- Configure Retrieve Media File to download the media from the mapped URL.
- In Convert to Video Type, ensure the binary data is formatted correctly for upload.
- Set up Upload Media to Gemini with the correct upload endpoint and authentication method.
- Use Prepare Gemini Payload to assemble the request body for analysis.
- Insert Await Upload Processing to wait for Gemini’s upload processing to complete before analysis.
Step 5: Set Up Gemini Analysis and Structured Parsing
Send the analysis request to Gemini and parse structured insights using the agent node.
- Configure Request Gemini Analysis to call the analysis endpoint using the payload from Prepare Gemini Payload.
- Connect Request Gemini Analysis to Parse Structured Insights to interpret the results.
- Open Gemini Chat Model and select your Google Gemini credentials for the language model used by Parse Structured Insights.
- Confirm Structured Output Reader is connected as the output parser for Parse Structured Insights.
Step 6: Configure Output to Google Sheets
Store the parsed insights in Google Sheets and loop through remaining batch items.
- Connect Parse Structured Insights to Save Results to Sheets.
- In Save Results to Sheets, select the target spreadsheet and worksheet for storing results.
- Map output fields (e.g., ad ID, summary, key findings) to columns in Save Results to Sheets.
- Ensure Save Results to Sheets connects back to Iterate Batch Items to continue processing the next video.
Step 7: Test and Activate Your Workflow
Run a manual test to confirm the full pipeline, then activate for production use.
- Click Execute Workflow from Manual Start Trigger to run a test.
- Verify that Save Results to Sheets receives new rows containing parsed insights.
- Check that Iterate Batch Items continues until all capped videos are processed.
- Once validated, toggle the workflow to Active for production use.
Common Gotchas
- Apify credentials can expire or need specific permissions. If things break, check your Apify token status and actor access in the Apify dashboard first.
- If you’re using Wait nodes or external rendering, processing times vary. Bump up the wait duration if downstream nodes fail on empty responses.
- Default prompts in AI nodes are generic. Add your brand voice early or you’ll be editing outputs forever.
Frequently Asked Questions
About 30 minutes if your accounts and sheet are ready.
No. You’ll connect services and adjust a few fields. The only “technical” part is pasting API keys into the right credential boxes.
Yes. n8n has a free self-hosted option and a free trial on n8n Cloud. Cloud plans start at $20/month for higher volume. You’ll also need to factor in Google Gemini usage plus Apify costs for scraping.
Two options: n8n Cloud (managed, easiest setup) or self-hosting on a VPS. For self-hosting, Hostinger VPS is affordable and handles n8n well. Self-hosting gives you unlimited executions but requires basic server management.
Yes, and you should. Update the prompt content in the “Refine Prompt Text” area and adjust the fields expected by the structured output parser so Gemini returns exactly what you want. Common customizations include adding a “target audience guess,” classifying the offer (trial, discount, bundle), and tagging the creative angle (UGC, founder-led, comparison, demo).
Usually it’s permissions. Make sure the connected Google account can edit the destination sheet, then re-select the spreadsheet and worksheet inside the Google Sheets node so n8n refreshes the IDs. If you renamed tabs, the node can also point to an old worksheet reference, which looks like a “random” failure.
Practically, as many as your n8n execution limits and AI budget allow.
Often, yes, if you care about repeatable research quality. This workflow has batching, filtering, and an AI parsing layer that’s easier to control in n8n, and you can self-host if you don’t want executions capped. Zapier or Make can work, but the moment you need “wait for upload,” structured parsing, and multi-step logic, it gets fiddly and expensive. If you already live in Google Sheets and just want a two-step “add a row,” keep it simple. If you want a real research engine, n8n is the better fit. Talk to an automation expert if you want help choosing.
Your swipe file should make you faster, not guiltier. Set this up once, keep feeding it, and let the sheet do the remembering.
Need Help Setting This Up?
Our automation experts can build and customize this workflow for your specific needs. Free 15-minute consultation—no commitment required.