Shopify Functions vs. apps: when to build custom back-end logic
Functions, a custom app, or an off-the-shelf app? A practical guide to choosing the right way to change how your Shopify store behaves at checkout and in the back end.
“Can we just change how the discount works?” is one of the most common requests we get. The honest answer is: it depends on where the logic needs to live. Shopify gives you a few ways to change back-end behaviour, and picking the wrong one is how stores end up with three apps stitched together to fake a single rule.
Here is how we decide.
What Shopify Functions actually are
Shopify Functions are small pieces of code that plug into specific extension points Shopify exposes — discounts, payment method customization, delivery customization, cart and checkout validation, and a growing list of others. They run on Shopify’s own infrastructure, which is why they are fast and why they survive platform updates instead of breaking on them.
The catch is that Functions only run where Shopify lets them run. You cannot invent a new extension point. If the thing you want to change is on that list, a Function is almost always the right tool. If it is not, a Function cannot help you no matter how clever the code is.
Functions are the supported replacement for the old Checkout Scripts, so if you are still on Scripts, this is also your migration path.
When an app is the better fit
An app is the answer when the work does not fit a Function’s extension point: a custom admin tool your team uses, a connection to a system you already run, a background job, a webhook-driven workflow, or UI that lives somewhere Functions do not reach.
There are two flavours worth separating:
- Off-the-shelf apps from the App Store. Great when an existing app does exactly what you need. The moment you are running several apps to approximate one workflow, or an app almost fits but you cannot change the part that matters, you have outgrown this option.
- Custom apps — software built for your store and installed only on it. This is where you go when no marketplace app does the job and the workflow is specific enough to be worth owning. We cover this in more depth under custom app development.
A simple decision path
- Is the change at one of Shopify’s extension points (discounts, payments, delivery, validation)? → Build a Function. It is faster and upgrade-safe.
- Does an App Store app already do it well? → Use it. Custom code you do not need is a liability, not an asset.
- Is it a workflow, integration, or admin tool that no app covers? → Build a custom app.
- Are you gluing multiple apps together to fake one behaviour? → That is usually the signal to replace them with one Function or one custom app.
Why the distinction matters for cost and longevity
Functions are cheap to run and cheap to maintain because Shopify hosts them and keeps the extension points stable. A custom app carries more — hosting, monitoring, and upkeep as the platform evolves — but it does things Functions simply cannot. The mistake we see most often is reaching for an app (or five) to do something a single Function would handle natively, and then paying for that decision every month in subscription fees and fragility.
The reverse mistake is rarer but real: trying to force genuinely custom workflow logic into a Function’s narrow extension point, and ending up with something brittle that fights the platform.
The short version
Use a Function when Shopify already exposes the behaviour you want to change. Use an app — off-the-shelf if one fits, custom if none do — when the work lives outside those points. And if you are not sure which bucket your problem falls into, that triage is the first thing we do on any checkout or Functions project.