How it works
Follow these 6 simple steps to start receiving automatic alerts when coupon code abuse is detected
Record Created
Record Created
Custom SQL Query
Custom SQL Query
Format order total by day including discounts
Format order total by day including discounts
Compare discount rates to identify coupon abuse
Compare discount rates to identify coupon abuse
Was coupon abuse detected?
Was coupon abuse detected?
Send Slack Message
Send Slack Message
Make it your own
Customize this workflow even further:
Include detailed discount data in the alert
Modify the Slack message to include specific numbers from {{custom.json_results}}, showing which days had high discount rates and the exact percentages to provide immediate context for investigation.
Adjust the baseline discount threshold
Change the 10% baseline in the AI prompt to match your actual average discount rate, or create different thresholds for different time periods (like higher baselines during known sale events).
Add email alerts for critical spikes
Connect an email step alongside or after the Slack message to notify leadership or finance teams when discount rates exceed severely abnormal levels, ensuring critical issues reach the right people.
Store abuse incidents in Google Sheets
Add a Google Sheets step after the filter to log every detected abuse instance with timestamp, discount percentage, and AI analysis, creating a historical record for pattern analysis and reporting.
Frequently asked questions
How do I set up the "Shopify Orders" data table that this workflow requires?
The easiest way is to add the template "Store Shopify Orders in a Database". This will setup the table exactly as needed.
If you want to build it from scratch, you'll need to create a separate workflow that syncs Shopify orders to a MESA Data table. Use a "Shopify Order Created" or "Order Updated" trigger and a "Data Record Create or Update" action to populate the table with fields for Created At, Total Price, and Total Discount. This provides the foundation data that the abuse detection workflow analyzes.
Can I change the 10% baseline discount rate to match my business?
Yes, edit the AI prompt in the "Compare discount rates to identify coupon abuse" step and replace "assume 10% if unspecified" with your actual typical discount rate. For example, if your average is 15%, change it to "assume 15% if unspecified" to reduce false positives.
What if I want to check more or less frequently than every hour?
Edit the trigger's poll schedule field. Adjust based on your order volume and how quickly you need to detect abuse. You may need to upgrade in order see faster frequency options.
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 receiving automatic alerts when coupon code abuse is detected?
Join thousands who've automated their work and saved an average of 3.5 hours every week.
Use this template — It's free7-day free trial • 8 min setup • Cancel anytime