Hi guys,
We’re running into limitations with Shopify Functions and hoping the community might have some ideas or workarounds.
We’re building an app that allows merchants to apply discounts to their products on Shopify using Shopify Functions to apply custom discounts based on various conditions.
Here’s the challenge:
As we’ve added more advanced features (like customer exclusions, tag-based targeting, quantity/spend minimums, etc.), we’re starting to hit Shopify’s function execution limits.
This typically happens when multiple conditional checks are required before determining discount eligibility.
For example:
- A store has several discounts set up, each with layered conditions (e.g., customer tag + exclusions + min purchase)
- Shopify Function throws an error or silently fails to apply the discount during checkout
- It seems to be related to exceeding the allowed complexity or execution time for the function
We’re trying to balance:
- Performance and reliability
- Providing merchants with granular control over who sees and can redeem each coupon
Has anyone found ways to work around these function complexity limits? We’re currently exploring workarounds.
One idea is to move some of the validation logic outside of Shopify Functions, validating eligibility on our end and syncing only valid discounts to Shopify. But this poses its own challenges — especially around ensuring discounts remain accurate in real-time and can’t be manipulated.
Any suggestions, architecture changes, or examples of how others are handling similar use cases would be much appreciated.