Shopify Flow: Looping Back to Check Conditions After a Wait Timer - Is It Possible?

Automating Store Credit for Published Reviews: A Shopify Flow Challenge

We've all been there, trying to automate a seemingly simple task in Shopify, only to hit a wall. Recently, in the Shopify community, NomNoms ran into an interesting problem while trying to automate store credit for published reviews using Shopify Flow. They wanted to trigger a flow when a new review comes in, check if it's published, and if not, wait a bit and then re-check the published status. The question was: can you actually loop back to the original condition after the wait timer?

The Initial Problem: Looping in Shopify Flow

Here's the scenario NomNoms described:

"I have a trigger (new review is coming in). I manually publish my reviews, so I check if the review is published or not. If it is not published (because I did not have time to do so) 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. From what I can see, I would need to create a new condition after the wait, checking for the published status again."

Essentially, NomNoms wanted to avoid manually publishing reviews and then manually awarding store credit. A noble goal! They were running into the limitations of Shopify Flow's structure.

The Community's Response: No Direct Looping, But Workarounds Exist

Tim_1, another member of the community, pointed out a key limitation of Shopify Flow: it uses a tree structure, meaning direct loop-backs aren't possible. This is a bummer, but not the end of the world.

As Tim_1 mentioned, "Flow tends to forget / reevaluate some things after “Wait” action. This usually makes sense." This can be a bit tricky when you're dealing with conditions that might change during the wait period.

The Solution: Re-Checking the Condition

The workaround, as NomNoms suspected, is to simply re-check the condition after the wait timer. While it's not as elegant as a loop, it gets the job done. Here’s how you can implement this:

  1. Trigger: Set up your trigger for when a new review is created.
  2. Condition 1: Check if the review is published.
  3. If Not Published: Add a "Wait" action for your desired amount of time (e.g., 1 hour).
  4. Condition 2: After the "Wait" action, add a new condition to check if the review is now published. This is the key step!
  5. If Published (after wait): Grant the store credit.
  6. If Still Not Published (after wait): You could either end the flow here, or add another wait and re-check (though this might get a bit cumbersome).

It's important to note that the second condition is completely separate from the first. Shopify Flow will re-evaluate the review's published status at that point.

Alternative Approaches and Considerations

While re-checking the condition works, there are a few other things to consider. Tim_1 suggested restructuring complex conditions. For example, instead of "if A or B", try "if A, else if B". This can sometimes simplify your flow and make it easier to manage.

Another option, depending on your comfort level, is to use a more powerful automation tool that allows for looping and more complex logic. However, for most Shopify store owners, sticking with Shopify Flow and using the re-check method is a good balance of simplicity and functionality.

NomNoms also considered auto-publishing all reviews. While this simplifies the flow, it might not be desirable if you want to moderate reviews before they go live. So, it's a trade-off between automation and control.

Wrapping Up

So, while Shopify Flow doesn't offer direct looping, re-checking conditions after a wait timer is a perfectly viable workaround. It might not be the most elegant solution, but it's effective and keeps your automation within the Shopify ecosystem. Remember to consider the trade-offs between automation, control, and complexity when designing your flows. And don't be afraid to ask for help in the Shopify community – there are plenty of folks who've been there and are happy to share their experiences!

Share:

Start with the tools

Explore migration tools

See options, compare methods, and pick the path that fits your store.

Explore migration tools