A user wants to create a Shopify Flow automation that checks if an existing customer has made a purchase within a specific timeframe before sending follow-up marketing emails. The goal is to avoid sending discount emails to customers who have already ordered.
Desired workflow:
Trigger for customers who haven’t purchased in X days
Send initial marketing email
Wait X days
Check if customer has ordered since the last action
If no order: send additional discount email
If order exists: end workflow
Initially, the user struggled to find a way to check order history and count. Another participant suggested using the “Get order data” action with date-based queries and a “Count” step to check for orders within a timeframe.
Solution approach:
Use GraphQL-style queries with created_at filters (e.g., customer_id:{{order.customer.legacyResourceId}} AND created_at:>='{{ "now" | date_minus:"14 days" }}')
Apply a Count step to the returned order list
A screenshot example was provided showing the query structure
The discussion remains open with the original poster requesting specific examples of implementing the Count step for this use case.
Summarized with AI on October 30.
AI used: claude-sonnet-4-5-20250929.
So I was looking to use flow without the extra need for yet another 3rd party app.
I have most of my marketing automations setup but I am struggling to find a way to do this;
Existing customer not bought x days -
Send marketing email
Wait x days
****Check if customer has order since x days or has customer order value increased since ****
If above is no
Send further email
If answer is yes
End
I hope above is easy enough to understand, I can’t seem to find away to check if customer has ordered since last action to then stop or send the customer potentially a larger discount email.
There are multiple query examples that have created_at in the query and some with customer, so not sure what you are referring to. The action returns a list of orders. You can count those with a “Count” step.
Here’s one that is pretty close. You just need to substitute dates in there: