Scripts to Functions

Can we prototype a discount-stacking or validation rule using Shopify Flow first, before committing budget to a custom Function build?

Short answer

Shopify Flow can test the data behind a discount or validation rule, not the rule itself, because Shopify Functions run during checkout (shopify.dev, October 2026). Flow acts after store events and is free on the Basic, Grow, Advanced and Plus plans (Shopify Help Center, October 2026). Run Flow first to prove your tags and metafields are populated.

Shopify Flow plans
Free app on Basic, Grow, Advanced and PlusSend HTTP Request needs Grow, Advanced or Plus, and tasks from custom partner apps need Plus.Source: Shopify Help Center (Shopify Flow)
When the Order created trigger runs
After a customer places the orderIt starts a workflow when an order is placed, or when a draft order is paid and converted, so a Flow workflow cannot change the price the customer saw.Source: Shopify Help Center (Order created)
Rule prototype, SMART Functions Creator
Free on a dev store; $19.99 a month liveSMART Functions Creator includes all features on dev stores, which process no real transactions; its Lite plan covers 2 active functions on a live store, with a 7-day trial.Sources: SMART Functions (SMART Functions Creator on the Shopify App Store); Shopify developer docs (Dev stores)
Shopify Scripts
Deactivated as of 30 June 2026Scripts still published that day stopped working, so a rule that ran as a Script needs a Function or an app now, not a prototype.Source: Shopify Help Center (Shopify Scripts and the Script Editor app)

Deploi’s call

Use Flow for the data rehearsal and a free Function builder for the rule rehearsal. They answer different questions and together they cost nothing. We would rather a client spend two weeks on this than two weeks of our time on a build that a report would have argued against.

WaitHold the build budget and rehearse first when

  • The rule depends on customer tags, metafields or a segment nobody has counted.
  • Nobody has summed the discount the rule would have given on last quarter's orders.
  • No Function builder has yet tried the rule on a dev store, Shopify's test store. SMART Functions Creator costs nothing there (SMART Functions Creator listing, October 2026).

BuildScope the custom Function when

  • The Flow rehearsal proved the segment exists and its discount is worth more than the build.
  • A no-code Function builder on a dev store could not express the rule as written.
  • Your store is on Shopify Plus, the only plan whose stores can use custom apps that contain Function APIs (application programming interfaces) (shopify.dev, October 2026).
  • You are restoring a rule that ran as a Shopify Script, because Scripts stopped working on 30 June 2026 (Shopify Help Center, October 2026).

Basis: Merchant-Editable Checkout Rules: Flow, Functions, or Both?, our Build vs. Buy decision record, scored CUSTOMIZE.

Can Shopify Flow stand in for a discount or validation Function?

Shopify Flow cannot stand in for a discount or validation Function, because the two run at different moments. Shopify Functions customize Shopify's backend logic "by running custom code during the checkout process" (Shopify developer docs, October 2026). Shopify Flow "monitors your store for events and lets you create a sequence of actions that are taken in response" (Shopify Help Center, October 2026).

Flow's Order created trigger, for example, "starts a workflow when an order is placed by a customer" (Shopify Help Center, October 2026). A workflow on that trigger runs after checkout has already set the price the customer saw, and that price decision is exactly what a discount prototype must test. So Flow reacts to the order, and a Function shapes it. The two still work together in production: Deploi's Flow and Functions record scores CUSTOMIZE when Flow writes a rule's value into a metafield and a Function reads it at checkout (Deploi decision record, October 2026). Which team builds the Function is a separate staffing decision.

What can a Flow rehearsal prove before a Function build?

A Shopify Flow rehearsal proves the data a discount or validation rule depends on, not the rule's logic, and the data is worth proving first. In our experience, Function projects that go badly rarely fail on logic; they fail because the data the logic needs was not where everyone assumed.

The rehearsal proves that data cheaply and safely. Shopify Flow is a free app on the Basic, Grow, Advanced and Plus plans (Shopify Help Center, October 2026), so the rehearsal costs calendar time, not a subscription. A rehearsal workflow that only tags orders is also low risk. Deploi's Flow test mode record scores tag-only workflows WAIT, because a wrong tag is undone with a bulk edit (Deploi decision record, October 2026).

How do you run a two-week Flow data rehearsal?

Run a two-week Shopify Flow data rehearsal in five steps, each answering a question that a Function build would otherwise answer expensively:

  1. Prove the segment exists. Build a Flow workflow on the Order created trigger, which fires when a customer places an order (Shopify Help Center, October 2026). Have it check the conditions your rule would check, then tag each matching order would-have-qualified. Let it run for two weeks, so the count covers a normal order mix.
  2. Count the result. Filter orders by the tag. If the count is near zero, the rule targets a segment that does not exist, and the Function was going to be an expensive way to find that out.
  3. Find the near-misses. Tag the orders that matched three of four conditions. That list is where your precedence and collision rules will actually get exercised.
  4. Prove the fields are populated. If the customer tag or metafield the rule relies on is empty on real orders, the Function would read it empty too. In our judgment, this is the single highest-value hour in the exercise.
  5. Estimate the value. Sum the discount you would have given on the orders that qualified. That number is your business case, and it decides build versus buy.

How do you prototype the rule itself without a build?

Prototype the rule itself in a no-code Function builder on a dev store, because a builder generates real Shopify Functions that run where a custom Function would. A dev store is Shopify's test store, and it "can't be used in production or process real transactions" (Shopify developer docs, October 2026).

SMART Functions Creator, an app from the developer SMART Functions, is free on dev stores with all features included (SMART Functions Creator listing, October 2026).

The prototype has two outcomes, and both are good. The builder expresses your rule, and you have your answer without a build. Or it cannot, and you now know exactly which part is custom. Pre-built Function apps and builders compares what builders cost on a live store.

In what order should you test a rule before paying for a build?

Test a discount or validation rule in four steps, cheapest first, so each step can stop the build before money is spent:

  1. A Shopify Flow rehearsal for two weeks: does the segment exist, are the fields populated, and what is it worth?
  2. A no-code Function builder on a dev store, Shopify's test store with no real transactions: can the rule be configured at all?
  3. A paid app, if a finished app covers the rule and its pricing works at your volume.
  4. A custom build for the part that survives steps 2 and 3, with alerting in scope, a layer Deploi's observability record scores CUSTOMIZE (Deploi decision record, October 2026).

Steps 1 and 2 cost nothing but calendar time, because Flow is free (Shopify Help Center, October 2026) and SMART Functions Creator is free on dev stores (SMART Functions Creator listing, October 2026). In our experience, those two steps rule out most of the builds that would have disappointed. What an agency-built discount Function costs prices step 4.

When is a Flow rehearsal not worth running?

Skip the Shopify Flow rehearsal when the segment is obviously large, when the rule reads only cart facts, or when you are restoring a rule that Shopify Scripts used to run.

Deploi’s point of view

Our own position, from building on Shopify. Kept apart from the sourced facts above.

Where we disagree
Flow gets recommended as a cheap prototype for checkout rules, and it is not one, because it runs after the decision the rule is supposed to make. What Flow is genuinely good for in this context is proving the data, and that framing gets almost no airtime.
What we tell clients to do first
Run the Flow rehearsal before anyone quotes the build. In our judgment it is the cheapest way to stop a Function project for the right reason, such as a qualifying segment that turns out to be forty orders a quarter, and nobody is upset about that outcome once they see the count.
What this page adds
The parent answer decides who builds a custom Function. This page shows how to avoid needing that decision: why Flow cannot stand in for a checkout rule, the five-step Flow data rehearsal, why a Function builder on a dev store is the better rule prototype, and the order of tests that rules out most builds before anyone quotes one.

When this answer changes

  • Shopify adds a Flow trigger or action that runs inside checkout, which would let Flow test a rule's logic.
  • Shopify changes Flow's plan availability, a free app on Basic, Grow, Advanced and Plus as of October 2026.
  • SMART Functions Creator drops its free dev store plan or changes its $19.99 Lite plan.
  • Shopify lets dev stores process real transactions, or changes which app plans they can use for free.
  • Deploi re-scores its Flow and Functions record, which scores a Flow-written metafield read by a Function CUSTOMIZE.

Related questions

This follows from Who actually builds custom Shopify Functions? Do we need an in-house developer or can an agency do it?

More in Scripts to Functions

Sources

Every figure on this page traces to one of these. Official and vendor pages are checked on the date shown; Deploi records are our own published decisions.

  1. Shopify Help Center, Shopify Flowhelp.shopify.com · checked October 8, 2026
  2. Shopify developer docs, Function APIsshopify.dev · checked October 8, 2026
  3. Shopify Help Center, Order createdhelp.shopify.com · checked October 8, 2026
  4. SMART Functions, SMART Functions Creator on the Shopify App Storeapps.shopify.com · checked October 8, 2026
  5. Shopify developer docs, Dev storesshopify.dev · checked October 8, 2026
  6. Shopify Help Center, Shopify Scripts and the Script Editor apphelp.shopify.com · checked October 8, 2026
  7. Deploi Build vs. Buy, Merchant-Editable Checkout Rules: Flow, Functions, or Both?deploi.ca · checked October 8, 2026 · Deploi research
  8. Deploi Build vs. Buy, Should You Build or Buy Your Shopify Scripts-to-Functions Migration?deploi.ca · checked October 8, 2026 · Deploi research
  9. Deploi Build vs. Buy, Build or Buy Observability for Checkout Functions on Shopify?deploi.ca · checked October 8, 2026 · Deploi research
  10. Deploi Build vs. Buy, Flow Test Mode on Shopify: Enough, or Build a Staging Path?deploi.ca · checked October 8, 2026 · Deploi research