Automatic Facebook Ad Creation from Spreadsheet Data - n8n Workflow

Use this powerful n8n workflow to automatically create and publish complete Facebook Ads, Ad Sets, and upload creatives based on data entered into a Google Sheet. Explore pre-built n8n templates.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Digital Marketing Managers looking to scale ad creation quickly.
Growth hackers needing to A/B test hundreds of ad creatives efficiently.
Agencies managing multiple client campaigns who require standardized n8n templates.
Users seeking robust n8n automation examples utilizing the Facebook Graph API n8n node and Google Sheets n8n node.

Overview

Managing high volumes of targeted advertising campaigns can be tedious when relying solely on the native Facebook Ads Manager interface. This specialized n8n workflow solves that problem by transforming a simple Google Sheet into a dynamic ad creation backend. When a new row is added containing the ad copy, image URL, and targeting parameters, the n8n trigger initiates the entire process.

This n8n template ensures that every step—from downloading the creative image via the HTTP Request n8n node, creating the Ad Set, defining the Ad Creative, and finally publishing the Ad—is handled automatically and reliably. It demonstrates the immense power of integrating multiple APIs through a single, cohesive n8n automation solution.

How it Works

This n8n workflow is initiated by the Google Sheets Trigger n8n node, which acts as the primary monitoring system. The flow follows these steps:


  1. Trigger and Data Capture: The Google Sheets Trigger n8n node listens for new rows in a specified spreadsheet, capturing all necessary ad parameters (copy, headline, image URL, budget).

  2. Specify Variables: The Set n8n node (named 'Specify variables') processes the incoming data, ensuring all necessary fields are correctly formatted before transmission to Facebook.

  3. Create Ad Set: The first Facebook Graph API n8n node creates the Ad Set, defining the targeting, optimization, and budget based on the sheet data.

  4. Fetch Creative: An HTTP Request n8n node, named 'Get image,' downloads the ad creative image content using the URL provided by the n8n trigger output.

  5. Upload Image: The subsequent Facebook Graph API n8n node handles the 'Upload Ad image,' registering the creative on Facebook's servers and returning a unique hash/ID.

  6. Define Creative: The 'Facebook Ad Creative' n8n node utilizes the previously uploaded image ID, combined with the primary copy and call-to-action data from Google Sheets, to build the final creative asset.

  7. Create Ad: The 'Create an Ad' n8n node finalizes the process by linking the Ad Set and the Ad Creative, publishing the live advertisement on the Facebook platform.

  8. Update Status: Finally, a Google Sheets n8n node updates the original sheet, recording the newly generated Ad ID or status confirmation, closing the loop on this efficient n8n automation.

Installation Guide

To deploy this n8n workflow, follow these steps:


  1. Import the n8n Workflow: Copy the provided JSON and import it directly into your n8n instance via the 'Workflows' section.

  2. Google Sheets Credentials: Configure the 'Google Sheets Trigger' n8n node and the 'Update Google Sheets' n8n node. You will need to select your Google Sheets credential and specify the Spreadsheet ID and Sheet Name where your ad data resides.

  3. Facebook API Credentials: Configure all four Facebook Graph API n8n nodes ('Create an Ad Set', 'Upload Ad image', 'Facebook Ad Creative', 'Create an Ad'). Ensure you use a Facebook Marketing API credential with sufficient permissions to manage Ads, Ad Sets, and Creatives under the designated Ad Account.

  4. Configuration: Review the data mapping in the 'Specify variables' Set n8n node and ensure the HTTP Request n8n node is correctly configured to handle file binary output.

  5. Activate: Set the Google Sheets n8n trigger to activate the automation. The n8n workflow is now ready to run whenever new ad specifications are added to your spreadsheet.

Node Details

Google Sheets Trigger (n8n trigger):
Function: Monitors a specific row or range within a Google Sheet for new data entry, initiating the n8n workflow.
Key Configuration: Set to trigger on new data added to the sheet.
Specify variables (Set n8n node):
Function: Standardizes and prepares the data payload from the n8n trigger before sending it to the Facebook API. This often includes renaming fields to match API requirements.
Create an Ad Set (Facebook Graph API n8n node):
Function: Calls the Facebook Marketing API to construct a new Ad Set, defining parameters like daily budget, targeting criteria, and campaign ID.
Get image (HTTP Request n8n node):
Function: Fetches the ad creative image file from a provided URL. Crucial for transferring the creative into the n8n workflow.
Upload Ad image (Facebook Graph API n8n node):
Function: Takes the binary image data received from the HTTP n8n node and uploads it to the relevant Facebook Ad Account asset library.
Facebook Ad Creative (Facebook Graph API n8n node):
Function: Constructs the creative asset using the uploaded image hash, headline, primary text, and link, preparing it for association with the final Ad object.
Create an Ad (Facebook Graph API n8n node):
Function: Finalizes the ad creation process by combining the Ad Set ID and the Creative ID, publishing the advertisement.
Update Google Sheets (Google Sheets n8n node):
* Function: Logs the output (e.g., the newly generated Facebook Ad ID) back into the original sheet, confirming the successful execution of this n8n automation.

Related n8n Workflows

Paid

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

Software Engineer

Featured*