Back to Case Studies

n8n ยท Supabase ยท Paid Media

Case Study: Building a 24/7 "Media Buyer" Bot with n8n to Stop Ad Waste

Zion Gonet

Zion Gonet

  • Aug 13, 2026
  • 3 min read

In paid media, time is money, literally. Every media buyer knows the sinking feeling of opening Ads Manager in the morning to find hundreds of dollars wasted overnight on a non-performing ad. Or, conversely, discovering a new creative finally took off, but 12 crucial hours were lost before the budget could be scaled.

This manual, reactive approach is inefficient, stressful, and a direct drain on profitability. We decided to solve this problem by building our own automated "Media Buying Agent" using n8n, Supabase, and Slack.

Media Buying Agent

Here’s a breakdown of the process.

 

๐Ÿšฉ The Challenge

Managing Meta ad accounts is a 24/7 job, but human teams aren't. The core challenge was replacing the constant, manual "patrol work" that was burning out expert media buyers.

  • Wasted Spend: Money was being burned on non-performing ads and broken funnels during off-hours, with no one to stop it.

  • Missed Opportunities: Winning creatives weren't being identified and scaled fast enough, leaving potential revenue on the table.

  • Hidden Problems: Platform anomalies like sudden CPM spikes, ad fatigue, or pacing errors would go unnoticed for 12-24 hours.

  • Human Bottleneck: Expert strategists were forced to spend their first hour every day "babysitting" accounts and checking for errors instead of focusing on high-level growth.

 

๐Ÿ’ก The Solution

I built an automated "Media Buying Agent" to act as a diligent junior buyer. Its purpose isn't to make changes, but to provide high-quality, actionable alerts every six hours that keep human experts in control.

This automation is orchestrated entirely in n8n, running on a 6-hour cadence. Here's the flow:

  1. Fetch Config: The n8n workflow first queries our Supabase database. This PostgreSQL database acts as our "brain," storing all our rules, target CPAs, ROAS goals, and "no-sales" spend thresholds for each brand.

  2. Pull Data: n8n then hits the Meta Marketing API to pull performance data (spend, purchases, CTR, etc.) for various rolling time windows (last 6h, 24h, 7-day trends).

  3. Run Logic: The workflow processes this data against the rules in Supabase, checking for five key areas:

    • Waste Prevention: Is any ad set spending money (e.g., > $100) with zero sales?

    • Spend Pacing: Is today's spend > 20% higher than the same 6-hour block yesterday?

    • Opportunity: Is a new creative scaling fast? Is an existing ad showing a high CTR and a low CPA?

    • Anomalies: Is CTR high but CVR (and CPA) terrible? (e.g., a broken landing page).

    • Ad Fatigue: Is an ad's CTR consistently declining over 7 days while its CPA is rising?

  4. Alert Team: If any rule is triggered, n8n formats a specific, actionable alert and posts it directly to the client's Slack channel, complete with links to Ads Manager.

 

๐Ÿ“ˆ The Impact

This agent provides proactive control and immediate, tangible results.

  • Waste is Stopped Instantly: The bot flags issues like an ad that spent $150 overnight with no sales, allowing the team to pause it immediately.

  • Winners Are Scaled Faster: The team gets alerted to new, high-performing creatives hours earlier, letting them scale winners before the momentum is lost.

  • Invisible Problems Become Visible: The agent detects subtle issues like ad fatigue or sudden CPM spikes, turning invisible drains into actionable data.

  • Expert Time is Reclaimed: Human media buyers are freed from "babysitting" Ads Manager. They can now trust the bot to handle the patrol work, allowing them to focus 100% on high-level strategy.


 

Stop "Babysitting" Your Ads

The bot in this case study is a real-world example of what we build at AutomationZion.

We build custom, high-ROI automations (powered by n8n, Supabase, and your stack) that free your expert team from manual "patrol work" and solve your exact business problems.

Ready to get your ad spend under control? Book a consultation.

Open to Full-Time Roles & Client Work

Looking for a GTM Systems / AI Automation Engineer, full-time, part-time, or contract? Let's talk.

AI Automation and GTM Systems Engineer

ยฉ 2026 AutomationZion. All rights reserved.