How to Automate Meta Ads Campaigns with n8n
n8n Meta Ads automation generates 3 AI ad copy variants from a brief, creates the campaign in PAUSED state via Meta API, and logs all IDs to Google Sheets.
The Manual Campaign Launch Problem
Writing three Facebook ad variations from scratch is creative work, but barely. It's mostly rewriting the same benefit statement with slightly different hooks. Then comes Meta Ads Manager: campaign objective, ad set targeting, budget entry, placement selection, creative upload, review, save. For a solo agency with five active clients, that sequence runs three times a week. It's not strategy. It's clicking.
n8n Meta Ads automation handles the mechanical half. Give the workflow a one-paragraph product brief and it returns a complete campaign: three GPT-written copy variants, each ad built via the Meta Graph API, linked to the ad set, and logged to Google Sheets. Telegram pings with all campaign IDs the moment the build finishes.
The total runtime is under 90 seconds. What fills an afternoon can run on a schedule before anyone at the agency is awake.
What n8n Meta Ads Automation Covers
The parts of campaign launch that don't require creative judgment:
- Generate 3 distinct ad copy variants (headline, body, CTA) from a plain-English product brief using GPT-4o-mini
- Create a Meta campaign via the Graph API in PAUSED state for human review before any spend
- Configure an ad set with targeting parameters, daily budget, optimization goal, and placement
- Build and link one ad per copy variant — campaign ID, ad set ID, and creative ID all chained from the API responses upstream
- Append every run's campaign and ad IDs to a Google Sheets audit log
- Receive a Telegram ping the moment the build completes, with all IDs ready for Ads Manager review
- Trigger on a daily Schedule or on-demand via Manual Trigger for sprint-style batch launches
The Campaign Build Pipeline
Every n8n Meta Ads campaign build follows the same execution path:
Manual Trigger (or Schedule)
→ Config Node (brief, ad account ID, page ID, targeting, budget)
→ OpenAI Node (generate 3 variants: headline / body / CTA each)
→ Code Node (parse JSON from model output, split into 3 items)
→ HTTP Request (POST /campaigns → returns campaign_id)
→ HTTP Request (POST /adsets → returns adset_id)
→ Split In Batches (iterate over 3 variants)
→ HTTP Request (POST /adcreatives → returns creative_id)
→ HTTP Request (POST /ads — links creative + adset)
→ Google Sheets (append IDs and copy strings to log row)
→ Telegram (send build summary with all IDs)
The Config node holds every campaign-specific value: the product brief text, ad account ID, Meta page ID, target country, age range, daily budget in cents, and model name. Nothing is hardcoded inside the HTTP Request nodes. Changing a client or brief means updating one node, not hunting through multiple API call bodies.
Step-by-Step: Wiring the Workflow
1. Generate the Ad Copy
The @n8n/n8n-nodes-langchain.openAi v2.1 node sends the product brief to GPT-4o-mini. The prompt asks the model to return a JSON array of 3 objects, each with headline, body, and cta keys.
The model output lands at $json.output[0].content[0].text. It's a string. Always. Even when you ask for JSON in the system prompt, the model wraps its output in text. Don't skip the Code node.
const raw = $input.first().json.output[0].content[0].text;
const cleaned = raw.replace(/```json\n?|```\n?/g, '').trim();
const variants = JSON.parse(cleaned);
return variants.map(v => ({ json: v }));
Without this parse step, the Split In Batches node downstream receives one string item instead of 3 separate objects. All three ads get identical copy, and the log row shows a single entry instead of three. The build doesn't error. It just silently produces wrong output. That's the failure mode to watch for.
2. Create the Campaign
The campaign POST goes to graph.facebook.com/v21.0/act_{ad_account_id}/campaigns (the actual ad account ID lives in the Config node, not in the URL template here). The request body needs three fields: name, objective (e.g., OUTCOME_TRAFFIC or OUTCOME_AWARENESS), and status.
Set status to PAUSED. Every time. A workflow that creates active campaigns has no spend floor. A misconfigured brief, wrong audience, or duplicate trigger run can drain budget before the morning standup. PAUSED is the checkpoint. Activating manually takes 2 seconds in Ads Manager. Running down the wrong audience for 6 hours doesn't.
3. Create the Ad Set
The ad set POST goes to graph.facebook.com/v21.0/act_{ad_account_id}/adsets. Required fields include campaign_id, name, optimization_goal, billing_event, bid_amount, daily_budget, start_time, and targeting.
The targeting parameter is a nested JSON object. Keep it in the Config node and reference it in the HTTP Request body with ={{ $json.targeting }}. Country codes, age range (age_min, age_max), and interest group IDs all live there. When a client's audience changes, one Config node update handles it.
One specific failure: Meta's v21.0 API returns a silent 400 error when bid_amount is missing, even when bid_strategy is explicitly set to LOWEST_COST_WITHOUT_CAP. Pass a floor value like 200 (representing $2.00 in cents) to avoid it.
Personal Meta access tokens expire after 60 days. On day 61 the workflow fails silently, with no error message, just a 401 that looks like a network timeout if you're not checking the execution log. Create a System User in Meta Business Manager, assign it Advertiser permissions on the target ad account, and generate a permanent token. Store it in n8n's credential vault, not in the Config node. Workflow JSON exports include Config node values in plain text.
4. Build the Ad Creatives and Ads
With 3 parsed variant objects flowing out of the Code node, the Split In Batches node iterates. Each iteration runs two HTTP Request nodes: first to create an adcreative (the POST accepts object_story_spec with page ID and link data), then to create the ad linking that creative to the campaign and ad set.
Reference the campaign_id and adset_id from earlier steps using n8n's node reference syntax. Don't assume they're available in $json inside the loop, so pull them explicitly with something like $('Create Campaign').first().json.id. Otherwise the ad creation steps fail on the second and third iteration when $json contains the creative data, not the campaign data.
5. Log and Notify
A Google Sheets Append node writes one row per run: timestamp, campaign name, campaign_id, adset_id, all three ad IDs, and the three headline strings for quick review. The Telegram node sends a summary. It's faster than opening Sheets to find the IDs you'll need in Ads Manager.
Implementation Patterns
Batch launch from a Sheets queue. Keep one Google Sheet with one row per client brief — columns for brief text, target country, budget, and a Status column. A daily Schedule Trigger reads all rows with Status = pending, iterates with Split In Batches, runs the full campaign build for each row, then writes launched back to the Status column. Ten client campaigns, one scheduled run. None of it requires opening a browser.
Day-of-week objective rotation. A Code node checks new Date().getDay() and selects a different Config object depending on the day. Monday runs OUTCOME_AWARENESS campaigns. Wednesday runs OUTCOME_TRAFFIC. Friday targets OUTCOME_SALES. Same audience, same brief, different objectives for a structured A/B test across objectives over a full week without manual effort.
n8n Nodes for Meta Ads Campaign Builds
| Node | Purpose |
|---|---|
n8n-nodes-base.scheduleTrigger v1.2 | Daily runs for scheduled batch launches |
n8n-nodes-base.manualTrigger | On-demand testing and one-off launches |
@n8n/n8n-nodes-langchain.openAi v2.1 | GPT-4o-mini ad copy generation |
n8n-nodes-base.code v2 | Parse JSON from model output, split into 3 items |
n8n-nodes-base.httpRequest v4.2 | All Meta Graph API calls |
n8n-nodes-base.splitInBatches | Iterate over 3 copy variants for ad creation |
n8n-nodes-base.googleSheets | Append campaign IDs and copy to audit log |
n8n-nodes-base.telegram v1.2 | Build completion notification |
Seven Steps to Your First Automated Campaign
- Create a System User in Meta Business Manager and generate a permanent access token with Advertiser permissions on the target ad account.
- Find your ad account ID in Meta Ads Manager — it appears in the URL as
act_XXXXXXXXXX. - Import the AI Ad Copy Generator & Meta Campaign Launcher template into n8n. The full pipeline ships pre-wired.
- Open the Config node and set the product brief, ad account ID, Meta page ID, targeting parameters, and daily budget in cents.
- Drop the System User token into an HTTP Header Auth credential in n8n's credential store. Point all three Meta API HTTP Request nodes to it.
- Trigger with the Manual Trigger first. Open Meta Ads Manager and confirm the campaign appears in PAUSED state with 3 linked ads.
- Review the copy variants in Ads Manager. You'll probably want to tweak one headline. Activate when you're satisfied.
The Meta Business Manager setup (System User, ad account assignment, token generation) usually takes longer than the n8n configuration. Budget 20 minutes for the Meta side on first setup.
The AI Ad Copy Generator & Meta Campaign Launcher ships this end-to-end — GPT-4o-mini writes 3 headline/body/CTA variants from your product brief, creates the campaign and ad set via Meta Graph API in PAUSED state, builds and links all 3 ads, logs every ID to Google Sheets, and pings Telegram on completion. It's part of The Complete n8n Templates Bundle, a one-time lifetime license to the full catalog if you're running more than one of these automations.
Monitoring Campaigns After Launch
Building campaigns is the easy half. Catching audience drift is harder. The Meta Audience Drift Guard template monitors every active ad set every 4 hours. When actual age distribution drifts more than 15% from your configured target range, it pauses the ad set via Meta API and sends a Slack alert with drift percentage, impressions affected, and campaign name — before more budget is wasted.
For broader performance monitoring, the n8n ad performance workflow covers pulling daily campaign metrics, scoring underperformers against a CTR floor, and alerting when campaigns need attention. The creation workflow and the performance workflow can share the same Google Sheets log, with campaign IDs from the build landing in the same tab the monitoring workflow reads.
Meta Ads is one channel in a larger stack. For a view of how n8n workflows connect across email, CRM, and social media in one marketing setup, automating marketing workflows with n8n is worth reading next.
Browse marketing automation templates →Common questions
How do I connect n8n to the Meta Ads API?
Can n8n generate Meta ad copy automatically with AI?
Should Meta campaigns created by n8n start in PAUSED or ACTIVE state?
Get the workflow templates this guide is built on
Import-ready n8n JSON, step-by-step setup, and tested end-to-end. One-time payment, own it forever.
Get 3 tested n8n templates, free
The full customer package for three real catalog templates — workflow JSON, step-by-step setup guide, credential checklist. Built through the same live-instance release process as everything we sell. Plus new templates and automation guides in your inbox. No spam, unsubscribe anytime.
- 01Smart To-Do List ManagerPre-built n8n workflow template that automates productivity with OpenAI. Live in about 10 minutes.$14
- 02Email Follow-Up AutomatorPre-built n8n workflow template that automates crm with OpenAI. Live in about 15 minutes.$12
- 03Market Trend AnalyzerPre-built n8n workflow template that automates data processing with OpenAI. Live in about 10 minutes.$14
More automation guides

How to Automate Appointment Reminders with n8n
A hair salon with 20 appointments on a Tuesday loses $240 in revenue from a single no-show if the average ticket is $80. That's one client, one empty hour, and no way to fill the slot on short notice.…

Automate Ad Performance Reporting with n8n Workflows
Most marketing teams lose the first two hours of Monday to the same ritual: open Google Ads, export yesterday's CSV, switch to Facebook Ads Manager, export another one, paste both into a spreadsheet,…

n8n Calendly Automation: The Full Booking Lifecycle
Someone books a call through your Calendly link. The meeting lands on a calendar, and that's where most automations stop. The rep walks in knowing an email address and nothing else. Nobody updates the…