# Shopify Functions Dynamic Limits

**URL:** <https://community.shopify.dev/t/shopify-functions-dynamic-limits/33690>\
**Category:** Functions\
**Tags:** discount-functions\
**Created:** [April 27, 2026, 9:14am UTC](https://community.shopify.dev/t/shopify-functions-dynamic-limits/33690 "2026-04-27T09:14:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kajo](https://avatars.discourse-cdn.com/v4/letter/k/ac8455/32.png) [@Kajo](https://community.shopify.dev/u/Kajo)\
**Post date:** [April 27, 2026, 9:14am UTC](https://community.shopify.dev/t/shopify-functions-dynamic-limits/33690/1 "2026-04-27T09:14:52Z")

</div>

Hi, I’m building a custom Rust function to power a much improved discounts engine + B2B per customer pricing.

I’ve been wrestling Shopify’s function limits for while now and have a system that can process 99.85% of our B2B orders without a problem but will have issues on carts over 100 lines (0.15% of our last 12 months’ orders have over 100 line items). The issues stem from the **20kb output limits**.

I think I can work through and push my solution up to accomodate 150 line items easily, and could probably squeeze 50 more line item capacity from there to get to 200. I would then need to know what the function outputs for functions on carts of over 200 lines would be as I know these increase dynamically.

My question is, how do these limits increase? Is there a formula I can use to work out what my output payload size can be from x number of cart lines? If I know I’ll be fine over 200 line items, I’ll push ahead squeezing what I can out of my current approach. Otherwise I’ll start working on a different approach.

Thanks!
