Note that this workflow makes use of Workflow level data storage.
Note that this workflow could be manually triggered as and when you need to use it, or it could use a scheduled trigger.
Your schedule should also be set so that you allow plenty of time for runs to complete. In a case where 3 attempts at starting a run are made while one is still completing, these runs are missed. They are not added to a queue.
The first step uses a Date/Time Helper to get today's date with the Get current timestamp operation:
The second step uses a Data Storage connector Get value operation (workflow level scope) to get the lastruntime key (the name of this key is arbitrary and you can name it whatever you wish):
This step uses a boolean connector to check if lastruntime is not 'null' (i.e. is it the first time the workflow has run?):
If the boolean returns false this indicates that it is the first time the workflow has run so we grab today's from the date time helper and pass it to the Created at max parameter for the Shopify List Orders operation:
If the boolean returns true then we can pull the lastruntime date value from data storage and pass it to the Created at min parameter for the Shopify List Orders operation:
The final step is to take today's date and set it as the lastruntime so it is picked up the next time the workflow is run: