Competitor Facebook Ad Analysis and Reporting - n8n Workflow

Use this sophisticated n8n workflow to automate competitive Facebook Ads analysis. It leverages scraping, OpenAI, and Google Gemini to extract rich data and automatically save reports to Google Sheets.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Marketing Analysts needing fast competitive intelligence.
Growth Marketers focused on optimizing ad creative.
Agencies looking for scalable ad tracking solutions.
Users seeking advanced multimodal AI integration within an n8n workflow.

Overview

Keeping track of competitor advertising is crucial but often manual and time-consuming. This specialized n8n workflow transforms competitive analysis into a seamless, automated process. It starts with an easy form submission and then intelligently handles the scraping of target Facebook Ads. The power of this n8n template lies in its use of advanced AI: it routes image-based ads to the OpenAI n8n node for detailed textual analysis and sends video ads through a dedicated path involving downloading, processing, and analysis via the Gemini large language model. This ensures comprehensive data extraction regardless of the ad format. Finally, all the structured competitive data is consolidated and saved to Google Sheets, providing a centralized and actionable report. Utilizing this robust n8n workflow drastically cuts down research time, enabling faster strategic decision-making.

How it Works

The entire process begins with the On form submission n8n trigger. Once activated, the n8n workflow executes the following steps:


  1. Scraping Initiation: The input data immediately triggers the Scrape Ads HTTP Request n8n node, which fetches the raw competitive ad data from an external source.

  2. Content Type Routing: The data then hits the Switch n8n node. This essential flow control step determines if the scraped ad is an Image or a Video, routing the item down the appropriate analysis path.

  3. Path A: Video Analysis: If the item is a video, it is routed to Download Video, followed by Extract from File. The Loop Over Items n8n node then manages batches, incorporating a Wait node to handle asynchronous AI processing or rate limits. The video data is sent via an HTTP Request to the powerful Gemini Video Decode process for deep analysis. Results are then formatted in the Final Video Values set n8n node.

  4. Path B: Image Analysis: If the item is an image, it is sent directly to the OpenAI n8n node. This step uses the OpenAI API (likely via the Langchain integration) to analyze the ad copy, sentiment, and creative elements. The output is then structured by the Final Image Values set n8n node.

  5. Data Consolidation and Reporting: The results from both AI paths are brought together using the Merge n8n node. The consolidated, rich dataset is then written to a Google Sheet using the Save Google Sheets n8n node, completing this powerful automation.

Installation Guide

To deploy this comprehensive n8n workflow, follow these steps:


  1. Import the n8n template: Copy the provided JSON and import it directly into your n8n instance using the 'New' -> 'Import from JSON' option.

  2. Set up Credentials: This n8n workflow requires credentials for the following services:

OpenAI: Configure your OpenAI API Key for the OpenAI n8n node.
Google Sheets: Set up OAuth or Service Account credentials for the Save n8n node to ensure it can access and write to your target spreadsheet.
* External Scraping/Gemini: Ensure any necessary API keys or authentication headers are configured within the HTTP Request n8n nodes (Scrape Ads, Gemini Video Decode) if they communicate with third-party services.

  1. Configure Trigger: Set up the On form submission n8n trigger details, ensuring the form collects the necessary input (e.g., advertiser ID, date range).

  2. Activate: Save the n8n workflow and set it to active.

Node Details

On form submission (n8n trigger): Initiates the entire n8n workflow upon receiving a webhook payload from a linked form. This is the starting n8n node.
Scrape Ads (HTTP Request n8n node): Responsible for making the initial external request to fetch raw ad data, likely targeting a specialized Facebook Ads library API.
Switch (n8n node): A core logic node that intelligently separates incoming data based on media type (image vs. video), ensuring the correct AI analysis path is followed.
Download Video (HTTP Request n8n node): Downloads the binary video file if the ad is classified as video content.
OpenAI (n8n node): Uses the LangChain integration to apply sophisticated AI analysis (e.g., summarization, tone analysis) to image-based ad creative and copy.
Extract from File (n8n node): Prepares the downloaded video file for subsequent processing, often dealing with binary data manipulation.
Wait (n8n node): Used to pause execution, crucial for managing asynchronous external API calls or respecting rate limits imposed by the Gemini service.
Gemini Video Decode (HTTP Request n8n node): Performs the heavy lifting for video analysis, using Google's Gemini LLM to transcribe or analyze video frames, returning structured data.
Merge (n8n node): Combines the structured results from the Final Image Values path and the Final Video Values path into a single item list for final output.
Save (Google Sheets n8n node): The final action n8n node, which appends the complete competitive analysis report to a designated Google Sheet spreadsheet.

Related n8n Workflows

Paid

Nodes: 11 Nodes
Updated: December 26 2025
View all
Created by

Featured*