Shopify Functions vs. Custom Apps: Choosing the Right Extension Point
Shopify Scripts are being deprecated, with full removal by June 2026 [citation:8]. The replacement — Shopify Functions — has matured significantly in 2025. Here's when to use Functions vs. building a full custom app.
The Critical Distinction
Shopify Functions run natively inside Shopify's backend infrastructure. They inject custom logic directly into core workflows like discounts, shipping, and payment rules [citation:5][citation:8]. They're not standalone applications — they're lightweight code snippets that Shopify executes.
Custom apps (private or public) run on your own infrastructure and communicate via Shopify's API. They handle complex logic, store data externally, and integrate with third-party systems [citation:1].
Shopify Functions: What They Actually Do
Functions now support:
- Discount logic (product, order, shipping discounts from one Function)
- Shipping rates (dynamic rules based on cart contents)
- Payment methods (conditional display rules)
- Cart validation (minimums, restrictions)
- Fulfillment constraints [citation:4][citation:3]
The 2025 upgrades that matter:
| Upgrade | Impact |
|---|---|
| New Discount API | Single Function can trigger multiple discount effects [citation:4] |
| WebAssembly API | Lazy-loading data, smaller binaries (40% size reduction) [citation:4] |
| Dynamic resource scaling | Limits grow with cart size; no more instruction limit errors [citation:6] |
| 25 Functions concurrently | Complex promotions now possible [citation:4] |
Performance data from Discount Kit migration: Instruction counts dropped 30% (610k → 430k). Binary sizes shrank 40% (249KB → 156KB) [citation:4].
When Functions Are the Right Choice
Standard discount rules. Tiered pricing, BOGO, cart value thresholds — Functions handle these natively without external infrastructure.
Shipping logic based on product attributes. Weight-based rates, regional rules, free shipping thresholds. Functions execute faster than API calls.
Simple cart validation. Minimum order values, restricted product combinations, quantity limits.
When you're not a Shopify Plus merchant. Functions work on all Shopify plans via public apps. Only Plus can build custom apps with Function APIs, but anyone can use existing Function-based apps [citation:8].
When You Need a Custom App
Integration with external systems. ERP, warehouse management, accounting software, CRM. Functions can't call external APIs directly.
Complex subscription logic. Recurring billing, usage tracking, dunning management. This requires data persistence and scheduled jobs.
Data that shouldn't live in Shopify. Customer PII requirements, custom analytics, proprietary business logic.
When public apps don't exist. If no app in the 8,000+ Shopify App Store solves your problem, and native Functions can't either [citation:1].
The Decision Matrix (August 2025)
| Your Need | Use Functions | Build Custom App |
|---|---|---|
| Tiered discounts / BOGO | ✅ Primary use case | ❌ Overkill |
| Dynamic shipping rules | ✅ Native capability | ❌ Too heavy |
| Cart validation logic | ✅ Built for this | ❌ Avoid |
| ERP/warehouse sync | ❌ Can't call external APIs | ✅ Required |
| Subscription billing | ❌ No persistence | ✅ Required |
| AI recommendations | ❌ No external compute | ✅ Required |
| B2B wholesale portal | ❌ Beyond scope | ✅ Required |
The Hybrid Pattern That Works
Many stores use both: Functions for real-time discount logic, custom apps for data synchronization.
Real example from community discussions: Teams use Functions for discount rules, while custom apps handle inventory sync with external warehouses. Configuration stored in shop metafields coordinates both systems [citation:2].
The Migration Warning
Scripts stop working June 30, 2026. If you're still on Scripts, start migrating now. Functions offer more flexibility but require different testing patterns — there's no preview mode like Scripts had. Use customer tags to test Functions on specific users before full rollout [citation:2][citation:8].
The Bottom Line
Start with native (Functions). Add prebuilt apps next. Only build custom when both fail [citation:10]. Most discount and shipping logic now lives in Functions. Most external integrations still need custom apps. The 2025 trend is clear: Functions keep absorbing what used to require custom builds. Check back in 2026 — that boundary will move further.