How it works

Follow these 4 simple steps to start adding free products to orders when customers use specific discount codes

Shopify logo icon

Order Created

App connector: Shopify • Time to complete: 0 minutes (Auto-configured)
Why this matters: This trigger monitors your Shopify store and automatically starts the workflow every time a new order is placed, ensuring no discount code usage gets missed.

This step activates whenever a customer completes their purchase on your store. The trigger captures all order details including discount codes, line items, and customer information. No configuration is needed - it automatically connects to your Shopify store and begins monitoring for new orders. The order data gets passed to the next step for discount code analysis.

Loop over the order's discount codes

App connector: Loop • Time to complete: 0 minutes (Auto-configured)
Why this matters: This step examines each discount code applied to the order individually, since customers might use multiple codes in a single purchase.

The loop processes every discount code that was applied to the order, creating a separate workflow path for each one. If a customer used three different discount codes, this step will check each code individually to see if any match your specified criteria. The loop automatically handles orders with no discount codes, single codes, or multiple codes. Each discount code gets examined by the filter step to determine if it matches your target code.

Filter for a specific discount code

App connector: Filter • Time to complete: 1 minute
Why this matters: This filter ensures the free product only gets added when customers use your exact promotional discount code, preventing the workflow from triggering on unrelated discounts.

You'll configure this step by entering the specific discount code that should trigger the free product addition. The filter compares each discount code from the loop against your specified code using an exact match. If the codes match, the workflow continues to add the free product; if not, it stops processing that particular discount code. Enter your discount code exactly as customers will type it, including any capitalization or special characters.

Shopify logo icon

Add Line Item to Order

App connector: Shopify • Time to complete: 2 minutes
Why this matters: This action adds your chosen free product directly to the customer's order with a 100% discount, making it completely free while maintaining proper inventory tracking.

You'll select both the product and specific variant you want to add as the free item. The step automatically applies a 100% discount to make the product free, sets the quantity to 1, and adds it to the existing order without notifying the customer via email. Choose your product from the dropdown menu, then select the appropriate variant (choose "Default Title" if the product has no variants). The free item appears on the customer's order confirmation and in your Shopify admin for proper inventory management.

Make it your own

Customize this workflow even further:

Set quantity limits
Control how many free products get added by modifying the quantity field or adding conditions to check if the free product already exists in the order.
Target multiple discount codes
Expand the filter step to check for several different promotional codes, or duplicate the workflow to handle different free products for different campaigns.
Add customer tags for tracking
Include a step to tag customers who receive free products, helping you segment these buyers for future marketing campaigns.
Send confirmation messages
Connect email or SMS steps to notify customers about their free gift, or alert your fulfillment team about orders containing promotional items.

Frequently asked questions

What happens if a customer uses the discount code multiple times in separate orders?
Each order triggers the workflow independently, so if a customer places multiple orders using the same discount code, they'll receive the free product with each qualifying order. You can modify the workflow to check customer purchase history if you want to limit the free product to first-time use only.
Will the free product affect my inventory levels?
Yes, the free product gets added as a regular line item with proper inventory tracking. Your stock levels will decrease when the free item is included in orders, so make sure you have adequate inventory of your promotional products.
Can I set different free products for different discount codes?
Currently this workflow handles one discount code and one free product. To offer different free products for different codes, you'll need to create separate workflows or modify the filter step to include multiple conditions with corresponding product selections.
What is a template?
Templates are pre-made workflows by our team of experts. Instead of building a workflow from scratch, these have all the steps needed to complete the task.
Can I personalize a template?
Yes! Every step can be customized to meet your exact requirements. Additionally, you can even add more steps and make it more sophisticated.
Are templates free?
Yes! Our entire library containing hundreds of templates are free to use and customize to your exact needs.

Ready to start adding free products to orders when customers use specific discount codes?

Join thousands who've automated their work and saved an average of 3.5 hours every week.

Start with this template — It's free
7-day free trial • 5 min setup • Cancel anytime