I want to dynamically set the datetime in the created_at filter to the current month’s first day and last day in the flow. currently, the information is hard-coded.
Here’s my shopify flow:
In the Get Order Data Action, here’s the script of in advanced query:
{{order.customer.id}}> AND created_at:>=2025-06-01T00:00:00Z> AND created_at:<=2025-06-30T23:59:59Z
Is there a way to dynamically change the value when next month comes? I can’t manually set the value in the flow every month even if I make a scheduled reminder. Manually changing is OPTION 1.
OPTION 2: My other idea is to create a backend (hosted in AWS) that can run once a month that updates the the order’s metafield like first_day_of_the_month and last_day_of_the_month.
The backend app will call a graphQL mutation to update. here’s the flow:
-
the backend app accepts customer ID or all order will be updated
-
Get all orders as we need the order ID to use in the graphql to update its metafield
-
Update the metafields using mutation
Or is there a simpler way to do it?
