Loop through orders at specific time and take action on only those orders that contain a tag

Topic summary

A merchant needs to identify fulfilled orders tagged ‘delivery failed’ (automatically added by their DPD shipping app) and trigger customer emails via Klaviyo. Since Shopify Flow lacks an ‘order tag added’ trigger, they’re using a Scheduled Time trigger with a For Each loop to periodically check orders.

Initial Challenge:
The condition checking for the ‘delivery failed’ tag was evaluating against all listed orders rather than individual orders within the loop, causing the Klaviyo action to fire incorrectly.

Solution Provided:
A community member suggested filtering orders directly in the query using tag:"delivery failed", eliminating the need for the conditional check entirely. The original poster confirmed this approach worked successfully.

Alternative Suggestions:

  • Using Liquid’s WHERE filter to sort by date ranges
  • Considering the Order Automator app as a backup solution for custom order processing automation

The issue appears resolved through query-level tag filtering, though one user mentioned having a similar problem with inventory-based product filtering.

Summarized with AI on November 13. AI used: claude-sonnet-4-5-20250929.

Many thanks, that worked. The option to query on tags is very useful, somehow I missed this in the docs