Common Shopify Functions mistakes that waste money or cause problems
There is a pattern to how Functions goes wrong: the setup is done once, by someone busy, and then the thing runs untouched while the store changes around it. The mistakes below are the ones that keep showing.
The short version: functions fall short anywhere the logic needs the outside world. Most of the damage in this category is not caused by choosing the wrong tool. It is caused by three habits: trusting the setup wizard, never looking at the edges, and never reconciling what the dashboard claims against what the orders say.
What the setup wizard got wrong
For carts up to 200 line items a function gets 11 million execution instructions, 128 kB of input and a compiled binary limit of 256 kB. Stores learn this one from the data, usually a month late. The related piece on Facet Counts That Lie: When the Filter Says 12 and the Shelf Holds 3 makes the same point from the ranking side, and it applies to Functions more directly than most teams expect.
Where the edges quietly bleed (Functions)
Functions cannot use clocks or randomness; anything time-dependent has to arrive as input data, because the same input must always produce the same output. Shopify provides Rust and JavaScript templates and strongly recommends Rust, which avoids failures on large carts. The fix is rarely a new tool; it is a rule written down and checked.
The report nobody checked
The documented APIs cover discounts, cart transform, delivery customization, payment customization, validation, fulfillment constraints and order routing. In production, watch for the silent failure mode: when a function errors or exceeds its budget, Shopify falls back to default behavior, so a broken discount function looks like a quiet week, not an outage.
A store can run up to 25 active discount functions, and discount functions follow Shopify's combination rules when several apply at once. Custom apps containing Function APIs are gated by plan, which is why the same app can behave differently on two stores. The real cost is the discipline: versioned deploys through an app, staging against real cart shapes, and someone on the team who can read the execution logs when a promotion misbehaves on a Saturday. We covered the neighboring problem in Ranking Site Search by Clicks, Revenue, or Neither: Picking the Signal That Lies Least, and it fails the way Functions fails: quietly, at the edges first.
Frequently asked questions
How does a store recover once these Functions mistakes are running?
In the order the money leaks: stop the setting that is actively costing, fix the eligibility edge, then reconcile one full cycle against the source system before changing anything else. A store can run up to 25 active discount functions, and discount functions follow Shopify's combination rules when several apply at once.
Which Functions mistake costs the most?
Usually the silent one, because it compounds. Functions cannot use clocks or randomness; anything time-dependent has to arrive as input data, because the same input must always produce the same output. A loud failure gets fixed in a week; a quiet one runs for quarters and gets baked into forecasts.
How do you catch Functions problems before customers do?
Reconcile on a schedule, not on a suspicion. Custom apps containing Function APIs are gated by plan, which is why the same app can behave differently on two stores. Pair that with one monthly check of the edge cases, the orders the setup was never designed for, because that is where the next mistake is already running.
What does it cost to leave Functions mistakes in place?
Writing the function is the small part. The mistakes themselves then tax that spend every month they survive, which is why the audit is cheaper than the habit.