Exit condition for post purchase-flow

Topic summary

A user is building post-purchase flows in Shopify Flow for 5 main products and needs to prevent customers from receiving emails if they make a new purchase while still in an active flow.

Two solutions were proposed:

  1. Customer metafield/tag approach:

    • Tag customers at flow start (e.g., active_flow = product_A)
    • Check this tag before each email
    • Create a separate flow triggered on new orders that removes the tag/resets the metafield
  2. Last order check (simpler method):

    • Before each email, verify if the triggering order is still the customer’s most recent purchase
    • Structure: Order trigger → Wait → Check if still last order → Send email if true
    • This condition needs to be added before all ~5 emails in the flow

The user confirmed they’ll implement the last-order check before each of their 5 recommendation emails. The discussion appears resolved with a working solution.

Summarized with AI on October 27. AI used: claude-sonnet-4-5-20250929.

Hi!

We’re building a post-purchase flow for each of our 5 main products. A few weeks after someone buys, we want to recommend other products in that flow.

My question is: if a customer makes another purchase while they’re still in a flow, how can I make them exit the current one?

I understand I need to add a condition before each email to stop it from sending, but I’m not sure what the simplest way is. In Omnisend, we could just set an exit condition – but in Shopify Flow, it seems a bit more complicated.

Any tips on how to handle this in a clean and reliable way? Thanks!

Hi @Alex901

Use a customer metafield or tag to track active flow status#### Step-by-Step:1. At the start of each post-purchase flow:

  • Add a tag or set a customer metafield like active_flow = product_A.
  1. Before each email in the flow:

    • Add a condition:
      “If customer metafield/tag equals ‘product_A’”, then send.
  2. Set up a second flow triggered on any new order:

    • Trigger: Order Created

    • Action: Remove tag or reset metafield active_flow = “”

    • This ensures that any new purchase clears the previous flow status, and the current flow stops.

  3. (Optional) Add condition in your main flow:

    • “If customer tag/metafield is not blank or doesn’t match this product’s flow → Exit flow / skip action.

      Thanks !

1 Like

The simplest way is to check whether the current order is the last one, like this:

1 Like

Thank you Tim! Do I do this before every email I send out in that specific flow?

Yes, I see it like this: order (trigger)=> Wait=> Check if it’s still the last order=> If yes, send e-mail.

Thank you! The flow contains about 5 emails where we recommend new products, so I assume I just put that before all of them.