🔓 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

Apify to Google Sheets, competitor ad insights ready

Lisa Granqvist Partner Workflow Automation Expert

Competitor ad research starts simple. Then you’re drowning in tabs, screenshots, half-copied ad text, and a “we’ll organize this later” spreadsheet that never gets organized.

Apify Sheets automation fixes that mess. PPC managers use it to keep weekly swipe-file updates from taking over their calendar. A marketing lead can finally share competitor insights without a 20-minute walkthrough. And if you run an agency, you stop rebuilding the same “ad intel doc” for every new client.

This workflow pulls ads from the Facebook Ad Library, filters for quality, runs AI analysis based on the ad format (text, image, or video), and writes clean, searchable rows into Google Sheets. You’ll see what it does, why it matters, and how to adapt it for your niche.

How This Automation Works

The full n8n workflow, from trigger to final output:

n8n Workflow Template: Apify to Google Sheets, competitor ad insights ready

The Problem: Competitor ad research turns into busywork

Checking the Facebook Ad Library is easy. Turning it into something your team can reuse is the painful part. You click through ads one by one, copy text into a doc, grab a link, try to describe the creative, and then… you do it again next week. Worse, the best insights often live in someone’s browser history or a random Slack message. The cost isn’t just time; it’s decision quality. When research is messy, you stop trusting it, so you go back to guessing.

It adds up fast. Here’s where it breaks down in real life.

  • Manually collecting 50 ads can eat up about 2–3 hours, and it still won’t be consistent across the team.
  • Video ads are the worst because you can’t “scan” them quickly, so the best angles get skipped.
  • Without a structured database, you can’t search by hook, offer type, or positioning, which means you keep re-learning the same lessons.
  • Teams end up “borrowing” competitor language too closely because there’s no rewrite step built into the process.

The Solution: Apify → AI analysis → Google Sheets intelligence

This workflow turns Facebook Ad Library browsing into a repeatable competitor intelligence system. It starts by launching an Apify-powered scrape against your chosen Ad Library search parameters. The workflow then filters ads by page likes (so you’re not wasting time on low-signal advertisers) and routes each ad into the right analysis path: text-only ads get copy and strategy analysis, image ads get visual breakdowns, and video ads get a deeper “what’s happening here?” description before they’re summarized. Finally, every ad becomes a structured record in Google Sheets with a summary, inspired rewrite, and creative recreation prompts, so you can search and share it like a real asset.

The workflow starts when you run it in n8n. From there, Apify delivers the raw ad data, the system categorizes each ad by format, and AI generates the “so what” insights. Google Sheets becomes your single source of truth, updated automatically as you run new competitor pulls.

What You Get: Automation vs. Results

Example: What This Looks Like

Say you track 5 competitors and pull 20 active ads per brand each week. Manually, you might spend about 3 minutes per ad to copy details, describe the creative, and drop it into a sheet, which is roughly 5 hours. With this workflow, you run the scrape once, let the batch processing and AI do the analysis, and review the completed Google Sheet at the end. Your hands-on time becomes closer to 30 minutes of checking and tagging, not half a workday of collecting.

What You’ll Need

  • n8n instance (try n8n Cloud free)
  • Self-hosting option if you prefer (Hostinger works well)
  • Apify to scrape Facebook Ad Library results
  • Google Sheets to store competitor ad intelligence
  • Google Drive for temporary video storage during analysis
  • OpenAI API key (get it from your OpenAI dashboard)
  • Gemini API key (get it from Google AI Studio)

Skill level: Advanced. You’ll be comfortable connecting APIs, adjusting prompts, and troubleshooting occasional file/permission issues.

Don’t want to set this up yourself? Talk to an automation expert (free 15-minute consultation).

How It Works

Scrape trigger. You run the workflow in n8n, which sends an HTTP request to launch the Apify Facebook Ad Library scraper using your pre-set search parameters.

Quality filtering and routing. The returned ads are filtered by page likes, then automatically categorized by media type (text, image, or video) so each format follows the right path.

AI analysis for each ad type. Text ads go to an OpenAI chat model for strategy and rewrite output. Image ads are analyzed with a vision-capable model so the workflow can explain what’s on the creative and why it works. Video ads are downloaded, stored temporarily in Google Drive, then sent through Gemini for video understanding before a final summary is generated.

Structured storage in Google Sheets. Each processed ad is appended as a new row with core identifiers (like ad archive ID and page details) plus the AI summary, rewritten ad copy, and creative recreation prompts.

You can easily modify the page-likes threshold to widen or tighten quality, based on your needs. See the full implementation guide below for customization options.

Step-by-Step Implementation Guide

Step 1: Configure the Manual Trigger

This workflow starts manually so you can validate the scrape and analysis pipeline before automating it.

  1. Add the Manual Start Trigger node as your entry point.
  2. Leave all settings at default since this trigger has no parameters.

Step 2: Connect Google Drive and Google Sheets

Video files are stored in Drive, and all ad records are appended to Google Sheets.

  1. Open Store Video in Drive and select the target Drive and folder.
    Credential Required: Connect your googleDriveOAuth2Api credentials.
  2. Open Retrieve Drive Video and confirm Operation is set to download and File ID uses {{ $('Store Video in Drive').item.json.id }}.
    Credential Required: Connect your googleDriveOAuth2Api credentials.
  3. Open Append Video Record, Append Image Record, and Append Text Record and select your spreadsheet.
    Credential Required: Connect your googleSheetsOAuth2Api credentials.
  4. Set Document to [YOUR_ID] and Sheet Name to gid=0 in each append node.

Step 3: Set Up Ad Library Scrape and Routing

This section pulls ads from Apify, filters by page popularity, and routes by media type.

  1. Configure Launch Ad Library Scrape with URL https://api.apify.com/v2/acts/XtaWFhbtfxyzqrFmd/run-sync-get-dataset-items and Method POST.
  2. Set JSON Body to the provided payload and keep Send Body and Send Headers enabled.
  3. Update the header Authorization to Bearer [CONFIGURE_YOUR_API_KEY] and keep Accept as application/json.
  4. In Filter By Page Likes, set the condition Left Value to {{ $json.advertiser.ad_library_page_info.page_info.likes }} and Right Value to 1000.
  5. In Route By Media Type, verify the rule expressions:
    Video uses {{ $json.snapshot.videos[0].video_sd_url }}, Image uses {{ $json.snapshot.images[0].original_image_url }}, and the fallback output is renamed to Text.
⚠️ Common Pitfall: The Apify request requires a valid API key in the Authorization header, and the Gemini requests require a key in the key query parameter. Replace [CONFIGURE_YOUR_API_KEY] in Launch Ad Library Scrape, Initiate Gemini Upload, Send Video to Gemini, and Gemini Video Analysis.

Step 4: Set Up Video Processing with Gemini and OpenAI

Video ads are downloaded, uploaded to Gemini, analyzed, summarized with OpenAI, and saved to Sheets.

  1. In Iterate Video Ads, keep batch settings default to process items sequentially.
  2. Set Fetch Video File URL to {{ $json.snapshot.videos[0].video_sd_url }}.
  3. In Initiate Gemini Upload, keep URL as https://generativelanguage.googleapis.com/upload/v1beta/files, and confirm the header X-Goog-Upload-Header-Content-Length is {{ $json.size }}.
  4. In Send Video to Gemini, set URL to {{ $json.headers['x-goog-upload-url'] }} and Input Data Field Name to data.
  5. Set Delay Before Analysis Amount to 15 to allow Gemini file processing.
  6. Configure Gemini Video Analysis with the JSON body using {{ $json.file.mimeType }} and {{ $json.file.uri }}.
  7. Open Generate Video Summary and confirm it uses model gpt-4.1 with JSON Output enabled.
    Credential Required: Connect your openAiApi credentials.

Step 5: Set Up Image and Text Summaries with OpenAI

Image and text ads are summarized using OpenAI before being written to Sheets.

  1. In Analyze Image Content, set Image URLs to {{ $json.snapshot.images[0].original_image_url }} and keep Operation as analyze.
    Credential Required: Connect your openAiApi credentials.
  2. In Generate Image Summary, confirm the message references {{ $('Iterate Image Ads').item.json.toJsonString() }} and {{ $json.content }} with JSON Output enabled.
    Credential Required: Connect your openAiApi credentials.
  3. In Generate Text Summary, keep the message content as {{ $json.toJsonString() }} and ensure JSON Output is enabled.
    Credential Required: Connect your openAiApi credentials.

Step 6: Configure Output Records and Throttling

Each media type is appended to the same Google Sheet and then throttled with waits to control throughput.

  1. In Append Video Record, map fields like summary to {{ $json.message.content.summary }} and video_prompt to {{ $('Gemini Video Analysis').item.json.candidates[0].content.parts[0].text }}.
  2. In Append Image Record, map image_prompt to {{ $('Analyze Image Content').item.json.content }} and summary to {{ $json.message.content.summary }}.
  3. In Append Text Record, map summary to {{ $json.message.content.summary }} and rewritten_ad_copy to {{ $json.message.content.rewrittenAdCopy }}.
  4. Set Pause After Video Save, Pause After Image Save, and Pause After Text Save Amount to 1 to throttle batch processing.
Tip: The wait nodes help prevent API rate limits when processing large ad batches.

Step 7: Test and Activate Your Workflow

Run a manual test to validate scraping, analysis, and sheet output before enabling production use.

  1. Click Execute Workflow on Manual Start Trigger to run a test.
  2. Verify that Launch Ad Library Scrape returns items, and Filter By Page Likes passes records with likes above 1000.
  3. Confirm that video, image, and text items reach their respective append nodes and rows appear in your sheet Facebook Ad Library Analyzer DB.
  4. Once verified, switch the workflow to Active for production use (or keep it manual if you only want on-demand runs).
🔒

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 in n8n credentials and the Apify task run logs 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.
  • Google Drive and Google Sheets permissions bite people constantly. Make sure the connected Google account can write to the target Sheet and upload to the chosen Drive folder.
  • 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 Apify Sheets automation automation?

About 3–4 hours, mostly for API setup and prompt tuning.

Do I need coding skills to automate competitor ad research?

No. You’ll mostly connect accounts, paste API keys, and edit prompts and filters. If you can follow a checklist carefully, you can run it.

Is n8n free to use for this Apify Sheets 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 Apify, OpenAI, and Gemini usage (this workflow is often around $200/month to operate at steady volume).

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 Apify Sheets automation workflow for industry-specific analysis?

Yes, and you should. Most customization happens in the AI prompt steps used for text, image, and video summaries, plus the “Filter By Page Likes” logic for quality control. Common tweaks include adding a niche-specific framework (AIDA, PAS, or “offer breakdown”), saving extra columns (like hook type or objection addressed), and changing the Apify search parameters to focus on certain regions or keywords.

Why is my Apify connection failing in this workflow?

Usually it’s an expired or incorrect Apify API token in your n8n credentials. Check the Apify run logs for the task to confirm the scraper actually returned items, then confirm your HTTP request headers match Apify’s expected auth format. If it works once and then starts failing, rate limits or quota can also be the culprit, especially on larger pulls.

How many ads can this Apify Sheets automation automation handle?

Hundreds per run is realistic, but your practical limit is API quota and how long you’re willing to let it process.

Is this Apify Sheets automation automation better than using Zapier or Make?

For this use case, yes, but it depends on your expectations. Zapier and Make are great for simple “send data from A to B,” yet this workflow needs branching logic (text vs image vs video), batching, waits, file handling, and multiple AI calls. n8n handles that without turning your automation into a fragile, expensive maze. If your goal is a lightweight log of a few ads, simpler tools can be fine. If you want a scalable competitor intel system you can sell or standardize across clients, n8n is a better fit. Talk to an automation expert if you’re not sure which fits.

Once this is running, competitor research stops being a recurring fire drill. You get a living Google Sheet your team can actually use, week after week.

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