Skip to content
Docs menu

Shopify Functions limits

Shopify runs every Function within strict limits. Playwright Checkout Rules is built to stay inside them, and most stores never come close. Here’s what they are and when they matter.

Instruction budget and very large carts

Shopify stops a Function that takes more than 11 million instructions (for carts up to 200 lines; the limit grows for bigger carts). If that happens, checkout continues without that Function’s changes.

Playwright’s Functions are written in Rust to stay well inside the budget. In our measurements, typical carts use well under a tenth of it, and 50-line carts up to about a quarter. The heaviest case measured, a 200-line cart with the heaviest line item rules that fit the size limit, went over in the discount Function, so Shopify would skip Playwright’s discounts for that cart. Most of the cost is Shopify reading the cart, which grows with the number of lines.

Settings size

The active rules of each area must fit in 10,000 bytes, about 10 kB, because Shopify passes nothing larger to a Function. Playwright checks this when you publish. See Size limit.

Shopify also caps the cart information a Function receives (128 kB for carts up to 200 lines). Playwright asks for only the fields its rules use.

Tags

The rules of one area can check at most 100 product tags and 100 customer tags, counted across all its rules. Tag conditions count a tag twice when it has capital letters (as typed and in lower case). Tags must match whole tags: “contains”, “starts with” and “ends with” aren’t available.

Discount codes

  • Codes must exist in Shopify. Playwright creates the exact codes your line item rules check for. See Discount code rules.
  • A code can be up to 255 characters. Longer codes aren’t created.
  • Customers can enter up to 5 product or order codes and one shipping code; rules check the first.

What Shopify Functions can’t do

  • Change quantities: quantity limits block checkout with a message instead.
  • Add items: free gifts are discounted once the customer adds them.
  • See cart weight, line item properties, whether a customer accepts marketing, the shipping rate’s source, or (in payment rules) the billing address.
  • Match part of a tag.
  • Rename or move wallets such as Shop Pay, Apple Pay and Google Pay.
  • Give an order more than one shipping discount.

Discounts and customizations per store

Shopify allows 25 automatic discounts per store, counting app discounts. Playwright uses at most two (“Playwright: discount rules” and “Playwright: shipping discounts”), plus the code discount “Playwright: discount codes”, one delivery customization, one payment customization and one checkout validation, however many rules you have.

Shopify plans

Playwright doesn’t check your Shopify plan. Shopify decides which plans and regions each kind of checkout customization works on, and some payment changes depend on your plan. See Payment rules.