Scaling Shopify Product Discount Functions: Limits on Creating One DiscountNode Per Variant

Hi Shopify community,

I’m building a Shopify app that implements campaign-based tiered pricing discounts for product variants using Shopify Functions. The rules are stored in variant metafields as JSON, including time-based conditions for start/end dates, quantity thresholds, discount types (e.g., percentage), values, and customer segments.

Quick Setup Recap:

  • Metafield: Namespace test, Key rules, Owner variant, JSON type.

  • Example JSON:

    {
      "cn": "Special Offer",
      "sd": "2025-09-22T10:14:00Z",
      "ed": "",
      "r": [
        {
          "q": "4",
          "t": "p",
          "v": "20",
          "c": "all"
        },
        {
          "q": "8",
          "t": "p",
          "v": "25",
          "c": "vip"
        }
      ]
    }
    
  • Tech Stack: Shopify Functions with Rust.

  • Goal: Apply dynamic, time-sensitive tiered discounts across variants efficiently.

The Concern:

In our current approach, we’re consolidating rules into a single discountNode for all variants to optimize performance. However, due to challenges with accessing current date/time in the function (as discussed in related threads), we’re considering a pivot to creating one discountNode per variant’s rules. This would ensure more granular control and easier time validation per variant.

For a large store, this could mean significant scale: e.g., 100 products with 50 variants each = 5,000 potential discountNodes.

Question:

Is there a limit on the number of discountNodes (or discount functions) we can create and apply in Shopify? What are the performance implications, API rate limits, or best practices for handling thousands of such nodes? Any guidance on quotas for Functions API calls or storage would be super helpful to evaluate feasibility.

Thanks for your expertise—looking forward to your thoughts!

The answer in this case, is that you can have up to 25 automatic discounts active at any one time. I would recommend you give your AI agent access to the Shopify MCP server - that way, it can know what the limitations are in Shopify directly.

Just to follow up on @bkspace suggestion to leverage the Shopify Dev MCP for focused assistance on building Shopify Functions, there’s info for using and setting this up here: Meet Shopify Dev Assistant: Build Shopify Apps Faster Than Ever (2025) - Shopify Ireland