🔓 Unlock all 10,000+ workflows & prompts free Join Newsletter →
✅ Full access unlocked — explore all 10,000 AI workflow and prompt templates Browse Templates →
Home n8n Workflow
January 22, 2026

Meta Ad Library to Google Sheets, smarter ad insights

Lisa Granqvist Partner Workflow Automation Expert

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

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

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.

  1. Add the Manual Start Trigger node as the workflow trigger.
  2. Connect Manual Start Trigger to Configure Defaults.
  3. In Configure Defaults, define any starting fields your workflow relies on (e.g., API parameters, prompt settings, or limits).
  4. Link Configure Defaults to Refine Prompt Text to prepare the analysis prompt.

Keep Configure Defaults minimal and centralized so downstream nodes can reuse consistent parameters.

Step 2: Connect Ad Library Retrieval and Ranking

Fetch ads, compute runtime, and rank them before filtering to video-only assets.

  1. In Refine Prompt Text, customize the prompt transformation logic as needed.
  2. Configure Fetch Ad Library Data with the correct API endpoint, headers, and query parameters.
  3. Connect Fetch Ad Library Data to Compute Runtime Days to calculate the active days for each ad.
  4. Send output to Rank by Reach or Duration to sort results by performance.
  5. Filter results with Keep Video Ads Only to ensure only video ads proceed.

⚠️ Common Pitfall: If Fetch Ad Library Data returns mixed media types, ensure the filter conditions in Keep Video Ads Only match the exact response field names.

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.

  1. Set Cap Videos for Review to constrain how many videos are analyzed per run.
  2. Map required fields in Map Key Fields (e.g., media URL, ad ID, caption text).
  3. Connect Map Key Fields to Iterate Batch Items so each video is processed one at a time.
  4. Ensure Iterate Batch Items routes its batch output to Retrieve Media File.

If you expect large volumes, keep batch sizes small in Iterate Batch Items to avoid API throttling downstream.

Step 4: Retrieve and Upload Media for Gemini Processing

Download the video, convert it as needed, and upload it to Gemini for analysis.

  1. Configure Retrieve Media File to download the media from the mapped URL.
  2. In Convert to Video Type, ensure the binary data is formatted correctly for upload.
  3. Set up Upload Media to Gemini with the correct upload endpoint and authentication method.
  4. Use Prepare Gemini Payload to assemble the request body for analysis.
  5. Insert Await Upload Processing to wait for Gemini’s upload processing to complete before analysis.

⚠️ Common Pitfall: If Gemini rejects uploads, verify that Convert to Video Type outputs a valid video MIME type and binary format.

Step 5: Set Up Gemini Analysis and Structured Parsing

Send the analysis request to Gemini and parse structured insights using the agent node.

  1. Configure Request Gemini Analysis to call the analysis endpoint using the payload from Prepare Gemini Payload.
  2. Connect Request Gemini Analysis to Parse Structured Insights to interpret the results.
  3. Open Gemini Chat Model and select your Google Gemini credentials for the language model used by Parse Structured Insights.
  4. Confirm Structured Output Reader is connected as the output parser for Parse Structured Insights.

Credential Required: Connect your Google Gemini credentials in Gemini Chat Model. Structured Output Reader is a sub-node; add credentials to the parent Parse Structured Insights flow via Gemini Chat Model, not the sub-node.

Step 6: Configure Output to Google Sheets

Store the parsed insights in Google Sheets and loop through remaining batch items.

  1. Connect Parse Structured Insights to Save Results to Sheets.
  2. In Save Results to Sheets, select the target spreadsheet and worksheet for storing results.
  3. Map output fields (e.g., ad ID, summary, key findings) to columns in Save Results to Sheets.
  4. Ensure Save Results to Sheets connects back to Iterate Batch Items to continue processing the next video.

Credential Required: Connect your Google Sheets credentials in Save Results to Sheets.

Step 7: Test and Activate Your Workflow

Run a manual test to confirm the full pipeline, then activate for production use.

  1. Click Execute Workflow from Manual Start Trigger to run a test.
  2. Verify that Save Results to Sheets receives new rows containing parsed insights.
  3. Check that Iterate Batch Items continues until all capped videos are processed.
  4. Once validated, toggle the workflow to Active for production use.
🔒

Unlock Full Step-by-Step Guide

Get the complete implementation guide + downloadable template

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

How long does it take to set up this Meta ads automation automation?

About 30 minutes if your accounts and sheet are ready.

Do I need coding skills to automate Meta ads automation?

No. You’ll connect services and adjust a few fields. The only “technical” part is pasting API keys into the right credential boxes.

Is n8n free to use for this Meta ads automation workflow?

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.

Where can I host n8n to run this automation?

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.

Can I customize this Meta ads automation workflow for different insight fields (like “persona” or “offer type”)?

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).

Why is my Google Sheets connection failing in this workflow?

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.

How many ads can this Meta ads automation automation handle?

Practically, as many as your n8n execution limits and AI budget allow.

Is this Meta ads automation automation better than using Zapier or Make?

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.

Lisa Granqvist

Workflow Automation Expert

Expert in workflow automation and no-code tools.

×

Use template

Get instant access to this n8n workflow Json file

💬
Get a free quote today!
Get a free quote today!

Tell us what you need and we'll get back to you within one working day.

Get a free quote today!
Get a free quote today!

Tell us what you need and we'll get back to you within one working day.

Launch login modal Launch register modal