BACK TO BLOG
USE CASESOctober 26, 20269 min read

Flag Wasted Ad Spend With an AI Agent, n8n and Birch

JH

By Joris van Huët

Enterprise Interim CMO & Marketing Leader · 15+ years · 50+ orgs

Published

2026-10-26

The short answer: if your paid social spends $20,000 a month across 30 or more ad sets and someone hunts for losers once a week, give the daily hunt to an agent and keep every pause behind a person's click. Built in n8n it costs $24 a month on Starter, whose 2,500 executions cover a daily schedule that counts one execution per run, 31 in a long month (n8n pricing, executions, checked on 26 October 2026). For example, an ad set at $70 a day that stops selling on a Tuesday and gets flagged that morning instead of the following Monday stops 6 x $70 = $420 sooner.

Disclosure: I may earn a commission through some links on this site. It does not change what this page says.

Waste is rarely one bad day. It is the ad set nobody opened since the last check. An agent is good at opening every ad set every morning, and bad at knowing which numbers to believe. So this build gives it a rule written by a person, the shop's order count beside the platform's, and no way to change anything without an approval.

Before the agent gets access:

  1. What a slow check costs. For example, with a $40 target cost per purchase, the rule "no purchase after $80 spent in 7 days" flags an ad set at $80; checked weekly instead of daily, a $70-a-day ad set can run 7 x $70 = $490 before anyone looks.
  2. The rule already in your media buyer's head. Write it as one sentence with a spend floor and a time window. The agent applies that sentence and nothing it invents.
  3. The credentials. A Meta access token with ads permissions, stored as n8n's Facebook Graph API credential, Shopify admin access and a Slack app for approvals (Graph API node, Shopify node, Slack approvals).
  4. The gap between the counts. Meta credits a purchase within 7-day click, 1-day view and 1-day engagement by default and models some results statistically (Meta Results metric). Google Ads counts click-through conversions for 30 days by default (conversion windows) and reports modelled conversions that can take up to 5 days to settle (modelled conversions). Your shop counts orders. For the last four weeks, set Meta's reported purchases beside shop orders carrying utm_source=facebook: that ratio is your baseline gap.

The free version: a rule that only tells you

Meta's automated rules include an action called Send notification only (rule actions). Build one at ad set level with your sentence, for example spend above $80 and purchases below 1 over the last 7 days, and the rule notifies instead of acting. When it fires, open the shop, count orders carrying that ad set's UTM, then pause by hand if the shop agrees. Meta's own page asks you to keep watching overall performance beside any rule (About automated rules).

For an account with a dozen ad sets, that is enough. What the agent adds is the shop's count and the platform's in one note, the reasoning written down, and a log of who approved what.

The build in n8n, one approval per pause

  1. Trigger. A Schedule Trigger on a Days interval at 07:30 in the workflow's time zone; each firing is one execution (Schedule Trigger).
  2. The agent and its brief. An AI Agent node with a chat model. The system message holds the rule sentence, the baseline gap and three prohibitions: never touch a budget, never pause except through the approval tool, report every flag with its numbers. n8n's documentation asks the prompt to name the tools that need approval and what to do after a denial (human-in-the-loop).
  3. What it reads from Meta. A Facebook Graph API node attached as a tool, which the node supports (Graph API node): a GET on the ad account's /adsets edge to list them (ad set reference), then a GET on each active ad set's /insights edge with date_preset=last_7d for spend and purchases (Insights API).
  4. What it reads from the shop. A Shopify node set to Get all orders, from which the agent keeps the same seven days (Shopify node). The agent writes the shop's total beside Meta's and says how far today's gap sits from the baseline.
  5. What it decides. Every ad set that meets the sentence gets a flag and a one-line reason. Ad sets near the line get a watch note, not a flag.
  6. The pause, behind a person. A second Facebook Graph API tool sends a POST to the ad set ID with the status set to paused, the update Meta's ad set reference documents. In the agent's Tools panel, connect this tool to a Human review step on Slack and build the message from $tool.name and $tool.parameters, so the approver sees the ad set, spend and purchases (human-in-the-loop). Approve and the pause runs; deny and the agent is told.
  7. Who may approve. List the approvers. With an empty list, anyone who can see the Slack message can respond, and the output records who did (Slack approvals).
  8. The morning note. The agent posts every flag, the decision and the approver to the channel, and a Google Sheets row per flag keeps the log you will need in week four.

Setup detail for the pieces: how to use n8n, and the n8n entry for plans.

The same job in Birch, without a workflow

Birch's Pro plan carries automated rules, at $99 a month billed monthly up to $10,000 of ad spend and $249 up to $30,000 (Birch pricing, Pro tiers, checked on 26 October 2026). A rule checks as often as every 15 minutes and can notify Slack or email when its conditions are met (creating rules), and Birch AI Routines run a saved instruction, such as a daily performance review, on a schedule (Routines). With Meta's MCP connected, Birch AI can pause ad sets, and every tool starts on Needs approval (Meta MCP tools). More in how to use Birch and the Birch entry.

Wherever an agent reaches Meta through its ads MCP server, someone with full control of the business portfolio can also set rules in Business Suite settings that block budget edits or cap budgets above an amount (Meta Business Help). Meta lists those rules as limited availability (rules).

Google Ads: wasted spend lives in search terms

On search, the leak is queries more than ad sets. Optmyzr's Rule Engine can run a strategy on a schedule with Add to Alerts, which raises an alert, in Slack too, when suggestions appear, rather than Apply Changes (Rule Engine automation). Changes proposed through its MCP wait on the Change Requests page until a person applies them (MCP user guide). Read Google on a date range that ends five days back, since modelled conversions can take that long to settle (modelled conversions). The walkthrough is in how to use Optmyzr.

What it costs each month

PieceFree optionPaid option
Meta automated rules and ads MCP serverNothing to pay; Meta names no feeSame
n8nCommunity Edition, self-hosted from GitHubStarter $24 a month billed monthly, 2,500 executions
Birch14-day trial with every feature, no cardPro $99 a month up to $10,000 of spend, $249 up to $30,000
OptmyzrTrial with no card; scheduled automations lockedEssentials $299 a month billed monthly at the $25K tier
Chat modelNoneYour provider's token charges

Prices checked on 26 October 2026 on the n8n, Birch and Optmyzr pricing pages and Optmyzr's trial article.

Checking that the flags paid off

  • What to count. Each week, the spend on ad sets that ended the week with no shop order carrying their UTM, as a share of total spend.
  • What to compare it with. The same share for the four weeks before the agent went live.
  • A holdout. Leave one comparable campaign outside the agent's scope for four weeks, then compare cost per shop order for both.
  • The approval log. If denials outnumber approvals, the rule sentence is too tight; rewrite the sentence, not the agent.

Everything above is a manual check, and enough. Later, if you want the platform-versus-shop comparison run continuously, and judged by what the ads caused rather than what they were credited with, that is the work of causal attribution software such as Causality Engine (disclosure: I founded it).

The default in the approval box

Birch's approval prompt for Meta actions opens with Always allow already selected, and choosing it turns that tool's permission to Always allow from then on (Meta MCP tools). One hurried keypress on a Monday converts a single approved pause into standing permission. Pick Allow once, or set the permission in settings so the default stops mattering.

FAQ

Why does Meta report more purchases than my shop?

Meta counts purchases inside its attribution setting, by default 7-day click, 1-day view and 1-day engagement, and some results can be modelled where data is missing (Meta Results metric). A purchase your email also claimed can sit in both reports. The shop counts it once.

Should the agent cut budgets too?

Not in this build. A pause is one decision a person can check in a minute; a budget belongs to the plan the buyer owns. Give the agent no budget tool, and where Meta's MCP rules are available, set budget edits to Blocked (Meta Business Help).

Does this work for TikTok?

Birch offers rules for four platforms, TikTok among them, and Birch AI drafts TikTok rules as well as Meta ones (creating rules, Birch AI). The n8n build would need TikTok's own API in place of the Graph API node.

TAGS
Paid SocialAI Agentsn8nBirchOptmyzrAd Spend

ABOUT THE AUTHOR

I am Joris van Huët, an enterprise interim CMO. 15+ years, 50+ organizations, including ING, P&G, Nestlé, BNP Paribas, WeTransfer and Vinted. I take on innovation projects (venture building, design sprints), agentic marketing (setting up and running AI agents) and hands-on multi-channel work. See the track record.

I wrote and published this with AI assistance, and I answer for it. Claims about my own experience are limited to the track record above, and a statistic links to its source or is labelled as an example. I sell interim and fractional CMO work, which is why this site exists. How this site is written.

Agentic marketing, built for your team

The agents in this article, built into your workflows and handed over to your team: the first one within two weeks.