AI-Powered Ad Copy Generation and Meta Ads Deployment - n8n Workflow

Automate Meta Ads creation using n8n. Analyze video/image assets with Gemini and GPT, generate ad copy, and deploy creatives via the Facebook Graph API. Use this powerful n8n workflow template now.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Marketing agencies handling high-volume Meta ad campaigns.
Digital marketers seeking to scale creative production using AI.
n8n users interested in advanced integration between AI models (Gemini, GPT) and social platforms.
Performance specialists needing to rapidly deploy A/B testing assets.

Overview

This sophisticated n8n workflow solves the challenge of manually analyzing creative assets and generating ad copy for large-scale Meta campaigns. By integrating advanced AI capabilities from Gemini and OpenAI (GPT models), it streamlines the process from file upload to final ad creation. The value lies in speed, scalability, and consistency: assets dropped into a Google Drive folder are automatically analyzed, compelling ad texts are generated, and complete video or image ads are created and pushed to the Meta Ads Manager via the Facebook Graph API. This powerful n8n template drastically reduces the time required for campaign preparation, allowing marketers to focus on strategy. Utilizing this repeatable n8n workflow is key to optimizing digital advertising operations.

How it Works

The flow operates in two distinct automation phases: asset processing and ad deployment.


  1. Asset Processing (Triggered by Google Drive): The Google Drive Folder Updated n8n trigger starts the process when a new creative asset is uploaded. The n8n workflow logs asset details in Google Sheets and filters for items needing analysis. If the asset is a video, the workflow orchestrates the upload to the Gemini API via several HTTP Request n8n nodes, including dedicated wait and check state n8n nodes (Wait 3 Seconds, Check State, If) to handle asynchronous processing. Both image and video analysis paths feed the content summary into specialized Langchain AI Agent n8n nodes, which use the OpenAI Chat Model and Structured Output Parser n8n nodes to generate highly formatted, campaign-ready ad copy. This output is saved back to Google Sheets.


  1. Ad Deployment (Manual/Scheduled Trigger): A secondary manual n8n trigger (When clicking ‘Test workflow’) is used to fetch unprocessed ad entries and critical campaign settings from Google Sheets. The flow uses a Switch n8n node to process each record based on media type (video or image). Using the Facebook Graph API n8n node, it handles media download and upload, including conditional logic for single- or multi-image ads. Finally, it uses the AI-generated copy to create the full ad creative and the final ad object in the Meta Ads Manager. The result is logged via a Google Sheets n8n node, confirming the successful deployment of the new creative using this comprehensive n8n workflow.

Installation Guide


  1. Import the n8n workflow: Copy the provided JSON data and import it into your n8n instance via the 'Workflows' -> 'New' -> 'Import from JSON' option.

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

Google Drive & Google Sheets: Connect your Google account for asset triggering and data management.
HTTP Request (Gemini): Configure credentials or API keys for interacting with the Google Gemini API.
OpenAI: Set up your OpenAI API key for the Langchain agent n8n nodes.
Facebook Graph API (Meta Ads Manager): Authenticate your Facebook account with permissions to manage ads (requires Admin access to the Ad Account).

  1. Configure Spreadsheets: Ensure the Google Sheets n8n nodes are correctly pointed to your designated tracking and settings spreadsheets.

  2. Configure Triggers and IDs: Update the Google Drive Folder Updated n8n trigger node to monitor the correct folder ID. Configure all Facebook Graph API n8n nodes with your specific Ad Account ID, Campaign ID, and Page ID as required.

  3. Testing: Execute the n8n template manually using the When clicking ‘Test workflow’ n8n trigger to ensure the ad deployment path functions correctly.

Node Details

Google Drive Folder Updated (n8n trigger): Acts as the entry point, initiating the entire n8n workflow when new creative files are uploaded.
HTTP Request (Gemini Upload/Analyze): Manages the communication with the Gemini API for uploading video files, checking processing status, and initiating video analysis.
AI Agent (Langchain n8n node): A core component that coordinates the Large Language Model (LLM) and output parser to execute complex prompt engineering tasks, resulting in structured ad copy.
OpenAI Chat Model (Langchain n8n node): Supplies the advanced generative capabilities, leveraging models like GPT-4.1 Mini to refine and structure the content based on input from Gemini or image analysis.
Structured Output Parser (Langchain n8n node): Ensures that the AI-generated ad copy (headline, body, description) adheres to a strict JSON format, making it easy to input into the Meta Ads creative fields.
Google Sheets (n8n node): Used extensively throughout the n8n workflow for data storage, state management, and tracking the analysis and deployment status of each creative asset.
If/Switch (n8n node): Essential flow control n8n nodes that route data based on file type (video vs. image) or image count (single vs. multiple images).
Facebook Graph API (n8n node): The final action step. This powerful n8n node handles all interactions with the Meta Ads platform, including asset uploads (Upload Ad Video), creative generation, and final ad deployment.

Related n8n Workflows

Paid

Nodes: 16 Nodes
Updated: December 26 2025
View all
Created by
Daniel Setzermann
Daniel Setzermann

Featured*