Shopify Flow: Re-checking Conditions After a Wait Timer (The No-Loop-Back Guide)
Hey everyone! I was just browsing through the Shopify Community forums, and a really insightful discussion popped up that I know many of you building out your Shopify Flow automations will find super helpful. It's about a common head-scratcher: how do you re-check a condition after you've added a 'Wait' timer to your flow?
Our friend NomNoms kicked off the thread with a classic scenario: they want to reward customers with store credit for published reviews. The flow triggers when a new review comes in. The catch? NomNoms manually publishes reviews. So, the goal is to trigger on a new review, wait for it to be published, and then give the credit. Simple, right? But here's where the 'Wait' action can get tricky.
The 'Wait' Action Dilemma: Why You Can't "Loop Back"
NomNoms explained their dilemma perfectly: "I check if the review is published or not. If it is not published... I add a timer, which waits for a certain amount of time. After this, I want to link back to the original condition, to check again if the review is now published or not. But here is where I am stuck, there is no option to do this."
This is a super common misunderstanding about how Shopify Flow is designed. Many of us, coming from traditional programming or even other automation tools, expect to be able to create a loop: check condition > if not met, wait > loop back and check again. But as tim_1, another helpful community member, wisely pointed out, "Flow uses tree structure, there is no loop-backs possible."
Understanding Flow's Tree Structure and Data Re-evaluation
This 'tree structure' is key. Imagine your flow as a decision tree, not a circular path. Once you go down a branch (e.g., 'Review is NOT published'), you can't magically jump back up to an earlier decision point. You have to keep moving forward.
Tim_1 also highlighted something crucial: "Flow tends to forget / reevaluate some things after “Wait” action." This means that when your flow pauses with a 'Wait' action, it's not holding onto the exact state of everything from before the wait. When the wait is over, Flow re-evaluates the current state of the object (in this case, the review) at that exact moment. So, even if you could loop back, the original condition might not be looking at the most up-to-date data.
What this all boils down to is that if you want to check a condition again after a 'Wait' action, you need to create a new condition block after the 'Wait'. You can't simply point back to an earlier one.
The Solution: Branching Out with New Conditions
So, how do you achieve NomNoms' goal of giving store credit only when a manually published review goes live? You'll need to embrace Flow's branching logic. Here's a step-by-step breakdown of how you could set this up:
- Choose your Trigger: Start with "Review created" (or "Review submitted" if your app has that specific trigger).
-
Initial Condition: Is Review Published? Immediately after the trigger, add a "Condition" block. Your condition would be something like:
Review is published. This creates two paths: "Yes" (it's published) and "No" (it's not). - If Yes (Published Immediately): If the review is already published (maybe you auto-publish some, or you're super fast!), you can go straight to your desired action: "Add store credit to customer."
- If No (Not Published Yet): This is where the 'Wait' comes in. If the review is not published, add a "Wait" action. How long should you wait? This depends on how quickly you typically manually publish reviews. NomNoms mentioned not wanting to keep the customer waiting a whole day. So, maybe 6 hours, 12 hours, or even 24 hours could be appropriate.
-
After the Wait: Add a NEW Condition. Once the 'Wait' period is over, you need to add another "Condition" block. This new condition will again check:
Review is published. This is crucial – you're not looping back; you're re-evaluating the current status. - If Yes (Published After Wait): If, after the wait, the review is now published, then you can proceed with your action: "Add store credit to customer."
-
If No (Still Not Published): What if it's still not published after your waiting period? This is where it gets a bit more complex. You have a few options:
- Add another Wait & Condition: You could add another 'Wait' action, followed by yet another 'Condition' to check again. This is what tim_1 referred to as potentially becoming "unsightly or difficult" because your flow will get very long horizontally.
- Notify Staff: Instead of another wait, you could send an internal email or Slack message to your team to alert them that a review is pending publication and a customer is waiting for credit.
- End the Flow (for now): You might decide that if it's not published after X amount of time, the flow simply ends, and the credit is handled manually later, or not given via this automation.
Considerations for Your Workflow
This scenario highlights a key decision point for many store owners: manual versus automatic review publishing. NomNoms mentioned, "or just auto publish all reviews" as an alternative. If your primary goal is to instantly reward customers for reviews, auto-publishing might simplify your Flow significantly, as the "Is published?" condition would almost always be 'Yes' immediately.
However, if manual moderation is critical for your brand, then building out these branched conditions is the way to go. Just be mindful of how many 'Wait' and subsequent 'Condition' blocks you add. A single, longer wait time might be more manageable than several short ones, depending on your manual review process.
Ultimately, understanding that Shopify Flow operates on a tree structure and re-evaluates data after a 'Wait' action is vital. It helps you design more robust and predictable automations, even if it means a few extra condition blocks. Keep experimenting, and don't be afraid to ask the community when you hit these interesting challenges!