Articles on: Regios Discounts

Shopify Functions API Limits

Our app is built on Shopify Functions, which allows discounts to integrate directly with Shopify checkout, cart, POS, and other native experiences.


However, Shopify Functions currently has several platform-level limitations that affect what our app can support. These restrictions are enforced by Shopify and apply to all apps built using Shopify Functions.


This article explains the main Shopify Functions API limits that Regios discounts can encounter.



Configuration Metafield Size Limit (10kB)

One of the most common limits merchants encounter is Shopify's metafield size restriction.


What is the limit?

Shopify Functions cannot read metafields larger than 10,000 bytes (10kB).


As documented by Shopify:

"Metafields with values exceeding 10,000 bytes in size will not be returned."


Our app stores discount configuration data inside metafields attached to the discount node. This means large or highly complex discounts may exceed Shopify's limit.



What counts toward the limit?

Your discount configuration may become too large if it contains:

  • Large numbers of products or variants
  • Many collections
  • Deeply nested logic
  • Repeated conditions
  • Multiple customer eligibility rules
  • Large exclusion lists
  • Complex branching logic


Common error message

If this limit is exceeded, you may see errors such as:

  • "Your discount configuration is too big"



How to Reduce Configuration Size


1. Enable Compact Format

The "Use compact format" setting significantly reduces configuration size and increases the number of products, variants, or collections that can fit inside a single discount.

For most merchants, this should always be enabled.


2. Remove Repeated Conditions

Avoid duplicating the same checks across multiple logic branches.

For example, instead of repeating:

  • Customer has tag
  • Product is in collection


inside every branch, place shared conditions higher in the logic tree and attach child conditions underneath them.


This reduces unnecessary configuration bloat.


3. Reduce Product or Collection Lists

If possible:

  • Use exclusions instead of large inclusion lists
  • Create automated Shopify collections
  • Consolidate product groups using tags or collections


Large lists consume significant configuration space.


4. Split Discounts Apart

If your logic still exceeds the limit, divide it across multiple discounts.

For example:

  • Discount A handles collections 1–5
  • Discount B handles collections 6–10


This workaround only applies to automatic discounts.



Shopify Functions Instruction Count Limit

Shopify also enforces execution resource limits on Shopify Functions.


Functions run directly during checkout and cart operations, so Shopify limits how much processing a function can perform.


What is the instruction count limit?

Shopify restricts the amount of computation a function can execute before timing out or failing validation.


This is commonly referred to as the "instruction count limit."


Complex discount logic may exceed this limit if it involves:

  • Very large carts
  • Many nested conditions
  • Large product matching operations
  • Excessive looping or branching
  • Multiple simultaneous eligibility checks


Why does this exist?

Shopify enforces strict performance limits because Functions execute during critical purchase flows like:

  • Cart
  • Checkout
  • POS


This helps ensure checkout performance remains fast and reliable for all merchants.



Shopify Functions Input Query Complexity Limit

Shopify also limits how much data a Function can request from Shopify's API.


Current Shopify limits include:

  • Maximum input query size: 3000 bytes
  • Maximum calculated query cost: 30
  • List query variables cannot exceed 100 elements


Some fields also carry additional query cost penalties.


For example:

Field Type

Cost

Metafield access

3

hasAnyTag

3

inAnyCollection

3

Standard leaf fields

1


How this affects Regios

Some requested features cannot be implemented because requesting additional Shopify data would exceed Shopify's input query complexity limit.


This especially impacts shipping discounts, which already require additional delivery-related data from Shopify.


As a result, certain combinations of features may not be technically possible within Shopify's current platform limits.


Examples include:

  • Some customer eligibility checks
  • Certain Markets-related functionality
  • Complex cart qualification logic



25 Automatic Discounts Limit

Shopify also limits stores to:

  • 25 total automatic discounts


This limit applies across all apps installed on the store, including Shopify-native discounts.


Important notes

The limit includes:

  • Shopify automatic discounts
  • Discounts from Regios
  • Discounts from other Shopify Functions apps


If the limit is exceeded, Shopify may prevent additional discounts from activating.



Why We Still Use Shopify Functions

Despite these limitations, Shopify Functions provide major advantages:

  • Native checkout integration
  • POS compatibility
  • Faster execution
  • Better reliability
  • No draft-order workarounds
  • More consistent discount behavior


We believe the benefits outweigh the platform limitations, and we continue to work closely with Shopify as the platform evolves.



Shopify Documentation


Shopify Functions Limitations

Shopify Functions Limitations


Shopify Functions Input Query Limits

Shopify Functions Input Query Limits



Updated on: 22/05/2026

Was this article helpful?

Share your feedback

Cancel

Thank you!