Add a Free Product to Orders When a Specific Product is Purchased

5 min setup
No coding required
Runs automatically

Increase sales and reward customers by automatically adding a free product to orders containing a specific item. This MESA workflow template checks each order for the designated product and, if it’s present, adds a free product to the order for fulfillment. Perfect for running promotions and building customer loyalty, this automation provides a seamless experience for customers and simplifies order management.

Shopify logo icon
Order Created
Loop: Number of matches
Filter
Shopify logo icon
Add Line Item to Order

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

How it works

4 steps to start adding free products when customers purchase specific items

Shopify logo icon

Order Created

App connector: Shopify • Time to complete: 0 minutes (Auto-configured)
Why this matters: This step monitors your Shopify store for new orders and instantly starts the workflow when a customer completes their purchase.

This trigger activates automatically whenever a new order is created in your Shopify store. It captures all the order details including line items, customer information, and product names. No configuration is needed - MESA connects to your Shopify store and begins monitoring immediately. The order data gets passed to the next step to check if the customer bought the qualifying product.

Loop: Number of matches

App connector: Loop • Time to complete: 1 minute
Why this matters: This step searches through all the items in the order to count how many match your target product, ensuring the free item is only added when the qualifying product is actually purchased.

This loop examines each line item in the customer's order and compares the product name against the qualifying product you specify. You'll need to enter the exact product name as it appears in your Shopify store in the "Which product must the customer purchase to be eligible for the free item?" field. For example, if you want to give a free sample when someone buys "Premium Face Cream", enter exactly "Premium Face Cream". The step counts all matching products and passes this number to the filter step.

Filter

App connector: Filter • Time to complete: 0 minutes (Auto-configured)
Why this matters: This step acts as a gate that only allows the workflow to continue if the customer actually bought the qualifying product, preventing free items from being added to orders that don't meet the criteria.

The filter checks if the count from the previous step is greater than or equal to 1, meaning at least one qualifying product was found in the order. If the customer didn't buy the target product, the workflow stops here and no free item is added. If they did buy it, the workflow continues to the final step. This comparison is automatically configured to look for 1 or more matches.

Shopify logo icon

Add Line Item to Order

App connector: Shopify • Time to complete: 2 minutes
Why this matters: This step actually adds the free product to the customer's order with a 100% discount, completing the promotional offer automatically.

This action adds your chosen free product to the customer's existing order as a new line item. You'll configure two key fields: "What is the free product you would like to add?" where you select the actual product from your store, and "What is the variant of the free product you would like to add?" where you choose the specific variant (or "Default Title" if there are no variants). The step automatically applies a 100% discount so the item appears as free, sets the quantity to 1, and adds it without sending additional notifications to the customer.

Ready to set this up? It only takes 5 minutes.

Our support team will even help you personalize this workflow for free.

Get started →

Make it your own!

Customize this workflow even further:

Set minimum purchase quantities
Modify the filter to require customers buy 2 or more of the qualifying product before receiving the free item, perfect for bulk purchase incentives.
Add multiple free products
Chain several "Add Line Item" actions together to give customers a bundle of free samples or complementary products when they hit your purchase threshold.
Store promotion tracking in tables
Save details about each free product redemption to your own database for analyzing which promotions drive the most sales and customer engagement.
Deploy AI agents for smart promotions
Let AI agents evaluate order history and customer segments to automatically choose different free products based on purchase patterns and customer preferences.

Common questions

Will this add a free product to orders that already contain the qualifying item from before I set up this workflow?

What happens if a customer buys multiple quantities of the qualifying product?

Can I set this up to work with product variants instead of just product names?

Ready to start adding free products when customers purchase specific items?

7-day free trial • 5 min setup • Cancel anytime

Need help? Our automation experts will help you personalize this workflow for free. Contact support