Pause a Facebook Ad Campaign When a Product Sells Out

4 min setup
No coding required
Runs automatically

Ads that keep running for a sold-out product waste budget on clicks you can't convert. This workflow pauses the product's Facebook ad campaign the moment it sells out, using a campaign ID you store on the product.

Shopify logo icon
A product variant sells out
Shopify logo icon
Get the product's Facebook campaign ID
Continue if a campaign is set and the product is sold out
Facebook logo icon
Pause the campaign in Facebook Ads

How it works

4 steps to stop paying for ads on products you can't sell

Shopify logo icon

A product variant sells out

App connector: Shopify • Time to complete: 1 minute

Runs when a variant's inventory hits zero.

Shopify logo icon

Get the product's Facebook campaign ID

App connector: Shopify • Time to complete: 1 minute

Read the product metafield that holds its campaign ID, for example custom.facebook_campaign_id.

Continue if a campaign is set and the product is sold out

App connector: Filter • Time to complete: 1 minute

Stop if the metafield is empty, or if other variants of the product are still in stock.

Facebook logo icon

Pause the campaign in Facebook Ads

App connector: Facebook • Time to complete: 1 minute

Set the campaign's status to PAUSED.

Trusted by 1,000+ merchants
Logo: Rothy's Logo: Adidas Logo: Allure Logo: GQ Logo: DraftKings Logo: Chubbies Logo: Made In Cookware Logo: MUD/WTR

Ready to stop paying for ads on products you can't sell

Get setup in 4 minutes.

Use this template →

FAQs

How does the workflow know which campaign to pause?

Save the campaign's ID in a product metafield, such as custom.facebook_campaign_id. You can find the ID in Ads Manager. Products with no ID are skipped.

Will it restart the campaign when stock comes back?

Build a second workflow on Variant In Stock that sets the campaign back to ACTIVE.

What if a campaign advertises several products?

It pauses when any one of them sells out, so give shared campaigns their own rule or leave them unset.

Personalize this template

Customize this workflow even further:

Set custom delays
Schedule actions to trigger after a set time period, such as sending follow-up emails 3 days after an event.
Chain multiple actions
Connect several steps together in one workflow, like tagging data, updating records, and notifying your team simultaneously.
Store data in tables
Save order details, customer preferences, or custom metrics in your own database for reference and reporting.
Deploy AI agents for smart decisions
Let AI agents evaluate complex scenarios and choose the right action path based on your defined rules.

You're in good company

"MESA has been a game changer for us. And, if you ever get stuck, their support team is always super helpful."

  • Ico star
  • Ico star
  • Ico star
  • Ico star
  • Ico star
PetFriendly

"It's like Zapier but exactly designed for Shopify. I have been able to complete all the workflows that I've needed."

  • Ico star
  • Ico star
  • Ico star
  • Ico star
  • Ico star
Zailys

"The MESA team has been amazing at helping us set up our automations. We would highly recommend this app!"

  • Ico star
  • Ico star
  • Ico star
  • Ico star
  • Ico star
Rothy's

stop paying for ads on products you can't sell

4 min setup • Fully supported if you need help