But how can i schedule this workflow to run only in a specific time window? I tried with the Schedule at trigger but that leads to other issues like order data retrieval etc:
Is there a reason you want to only add tags at specific times? If so, you’ll need a Schedule time trigger and then a Get order data action, which you can probably configure with a query that returns orders that have one of your relevant tags and don’t yet have the “loyalty_club_member” tag, so you can batch through the orders. You’ll also need a For each loop to Add order tags to each of the orders returned by the action.
Thanks so much for the help. I will try it out today!
The reason for adding tags at specific times is, that we can then configure our ERP System to add a gift to the orders with that tag. This is to support special promotions during certain holidays etc.
I realized, however, that this flow would still not just return me the orders from that specified timeframe. Which is a problem, because I want just those orders of that specific day to be tagged. Would you have a solution for this?
Also I am new tho queries so i am not sure if the following query would work:
The documentation for the query search syntax provides examples of using date filters in the order query. For example, if you set the “Scheduled time” trigger to launch at 12pm, then a filter in the query on the “Get order data” of {{ "now" | date_minus: "12 hours" }} would return all orders that match the criteria from 12am to 12pm.