How To 100% Automate Your Meta Ad Builds Using N8N (free template)
34 min: self-host n8n, import his free template, drop creatives in Google Drive folders and ads get built in Meta from templates. He uses it for his own ads. Sponsored by Hostinger.
Tools featured in this playbook
This article was originally posted on YouTube
This system takes all the images and videos from specific Google Drive folders and automatically builds ads with them in your Meta ad account. I'm Caleb Kruse. I've been running ads on Meta for over 12 years and managed over $150 million in ad spend. I hate repetitive tasks. Every click inside Ads Manager hurts my soul. This is the simplest way to create ads without touching your ad account.
Step 1: get n8n running
There are two ways to run n8n: their hosted cloud, or self-hosting. I self-host on Hostinger, which has a one-click n8n deploy and costs a fraction of n8n cloud. The biggest perk of self-hosting: no limits on executions or workflows. You are only capped by the server memory you choose. That fits an automation you want running all the time.
In Hostinger, go to VPS, get a KVM VPS and choose a server location.
Search for n8n and select it (plain n8n, or the version preloaded with 100+ workflows).
Create a password and save it.
Once the VPS is ready, click Manage, then "Manage app" to open n8n.
Step 2: import the template
Click "Create workflow", then the three dots at the top right, "Import from file", and import the template's JSON file.
Step 3: add the Google credentials
Open the "Pull creative library" node and create a new credential.
In the Google developer console (console.developers.google.com), create a new project.
Under "APIs and services", enable the Google Drive API. Also enable the Google Sheets API, otherwise the first node errors.
Go to Credentials, "Create credentials", "OAuth client ID". Configure the consent screen first (app name, your email, internal use).
Application type: web application. Copy the OAuth redirect URL from n8n into "Authorized redirect URIs" and create.
Copy the client ID and client secret into n8n, save, and sign in with Google.
The Google Sheets nodes and the Google Drive nodes each need a credential. Both use the same client ID and client secret.
Step 4: add the Meta credential
Go to developers.facebook.com, My apps, "Create app". Use case: Other. Type: Business.
On the app page, add the Marketing API product.
Under Tools, select the token permissions
ads_management,ads_readandread_insights, and click "Get token".Paste the access token into the credential of the "Upload creatives to Meta" node and save.
Switch the app from development to live. It asks for a privacy policy URL. This is an internal tool, so any privacy policy URL works.
If some Meta nodes still show a warning, double-click into each one and close it. That clears it.
Step 5: set up the Google Sheet
Copy the n8n Ad Builder Google Sheet template (link in the video description).
Copy the sheet ID from its URL (the part after
/spreadsheets/d/).In the workflow, open the "Start here: input fields" node and paste the ID. Only the ID, not the full URL. Leave the creative library and settings names as they are.
Step 6: fill in the settings tab
Each row in the settings tab needs:
Google Drive folder ID: from the folder's URL. It can be an upload queue folder or one folder per campaign type.
Ad account ID: from Business Manager, or the
act=number in the Ads Manager URL. The Facebook login you built the app with must have access to this ad account.Template image ad ID and template video ad ID: pick ads that represent how you want your ads built, for example a top performer. There are separate flows for images and videos.
Target ad set ID: where the new ads go.
The best structure for this tool is one campaign with one ad set, or one ad set per creative folder. Creative becomes your pivot: a folder per persona, per stage of awareness or per format (video, UGC, AI content).
Step 7: run it
Click "Execute workflow". It grabs the creatives in the folder, checks the sheet to see which were already uploaded, uploads the new ones to Meta, copies the template ad, swaps in the new creative and writes everything back to the creative library tab, with the asset ID and ad ID.
In my test, five ads were created in the target ad set. All the ad copy was the same as the template. Only the image changed.
Step 8: schedule it
There are two triggers: manual and schedule. Double-click the schedule trigger and set the interval (I used every minute for the demo). Save, then hit Publish. Check the Executions tab to see it running.
From here you never need to open n8n. The settings tab is your builder. Add a row with a new folder ID, templates and target ad set, and drag creatives into the folder. Minutes later the ads are live.
Limits to know
It only reuses the template's ad copy. You can't swap the text in this version.
Videos must be under 100 MB. Bigger files are logged as an error in the creative library.
It does not go through subfolders. Creatives must sit directly in the folder you gave.
Whatever AI creative enhancements are set on your template are applied to every ad built from it.
How the automation works
Two triggers: schedule or manual.
Input fields: which Google Sheet and tabs to use.
Pull the creative library and build a list of what was already uploaded, so there are no duplicates.
Get all the Drive folder IDs from the settings tab and loop over each folder.
Route new creatives to the video flow or the image flow.
Video flow: check the size, download from Drive, upload to Meta with an HTTP node, loop until Meta has processed the video, get the thumbnail URL, get the template ad creative, swap the video in the JSON, create the copy in the target ad set.
Image flow: the same, but it processes several images at once, so it's much faster.
Rename the ad after the file name. You can build your own naming convention here.
Write the result to the creative library tab.
Comments
Login to leave a comment