Seeing a similar issue myslef. Did you ever get resoltion to this?
Topic summary
Issue: Users are encountering production errors when running scripts in Shopify’s Script Editor, despite scripts working fine in testing. The primary error is “InstructionQuotaExceeded,” triggered when customers create extremely large carts (e.g., 1 million quantity items).
Root Cause: The scripts fail when processing carts with abnormally high quantities or item counts, likely from users attempting to exploit discounts or break checkout.
Workarounds Shared:
- rancet’s solution: Added boundary conditions to detect oversized carts before applying discounts. If quantities exceed safe thresholds, the script ignores the cart entirely rather than attempting discount calculations.
- Kneeko’s approach: Implemented a
CartCleanupCampaignclass that removes line items exceeding a maximum quantity (200 per item) before processing, preventing the quota error.
Current Status: No official resolution exists. Multiple users report the same issue. The shared solutions are temporary fixes, as Shopify Scripts will be deprecated soon. Users are implementing cart validation checks (max items: 20, max quantity: 80-200) to prevent script execution failures.