Shopify Flow is an ecommerce automation platform that enables you to automate tasks and processes within your store and across your apps.
Hello.
I am trying to setup a scheduled email ( I have the template created ) and can attach to the flow. However I want to send out only to a certain customer group, but I cannot find where that is.
I select the trigger ( Flow ) - Scheduled Time, but after then I cant find that customer section.
I have my customer setup into segments and a metafield custom.customer_group
Some help onthis would be appreciated.
I have just installed to take a look. Will shopify/ flow/ email not deal with this internally?
Usually it's like this:
Not sure about the metafield though -- to what object it is attached? If you want to get customers from metafield, need to find the object it's attached to, then loop over the metafield contents.
Hi. Thanks for the reply. I was able to do that, i ran query to get the customers in the segment i needed, but theres a limit on the number of customers to 100, what happens to other the customers within the segment
I do not know what you're trying to achieve in details, maybe there is a better solution possible, say look under Marketing tab in Admin...
Flow would do nothing to the rest of the segment after first 100.
You may do more loops or schedule more often and after processing the customer, tag 'em and skip tagged customers in Get Customer Data...
And you may tag=> wait (say a day)=> remove tag, so they are ready for the next campaign.
Marketing automation does not have a way to send bulk email campaigns via their action. So you need to send them 1x1. That is possible, but you'll need to use an action to "Get" the customers and then a "For each" action to loop over the customers (caveat - this action has a limit of 100 at a time).
The "Get customer data" action does not yet support segments, because the API doesn't yet. But you can query by metafield values, if those metafields are indexed. This shows the syntax for the query https://shopify.dev/docs/apps/build/custom-data/metafields/query-by-metafield-value#querying-product...
Something like:
metafields.custom.material:"cotton"
Hi.
I have this so far, its not tested. But why is there a customer limit of 100
with this query on Get customer data
It's a Flow product limitation right now, in that pulling that much data can bump into API limits and also storage limits. So assume you need to workaround it.
Regarding the query, you do not put in a SQL query. I'd encourage your to read help for the action. This is a query to the Admin API, and you only need the text that would go in the query field (the metafields part I shared above).
https://help.shopify.com/en/manual/shopify-flow/reference/actions/get-customer-data
Ok, so just metafields.custom.customer_group = 'Re-Seller'
How would you go about sending emails for the remaing customers after that first 100.
There was a suggestion ( Thank you Tim ) futher up the conversation of this;
You may do more loops or schedule more often and after processing the customer, tag 'em and skip tagged customers in Get Customer Data...
And you may tag=> wait (say a day)=> remove tag, so they are ready for the next campaign.
If I could do the first 100, then tag, then run it again immediately ignoring those which had tags, then have those tags removed ( could be within a few hours ), keep repeating until no customers left.
Could you advise as to how that would layout?
Yeah, that's a good approach. Add something like "tag_not:processed" to your query. And then put an Add customer tag (processed) after the email action
Ive added the tag: processed after the email action, a couple of things;
1. how do join the not:processed with my query
2. then loop round to the second step and do the whole process again until there are no customers not:processed
3. remove the processed tag within a certain time frame
The action has links to help for both the query filters available and syntax. Roughly you can add OR and AND between filters and also use parantheses
I don't understand your other questions as they are vague
For the #3 the actions should be like this:
"Add customer tag" => "Wait: 3 days" => "Remove customer tag"
For the #2 -- simply schedule your Flow more often, say once per hour and then regulate the frequency by setting the "wait" parameter.
Basically, if a customer was sent e-mail they keep the tag for 3 days and does not get any new e-mails, then tag's removed....
Say, you have 500 e-mail targets. With runs scheduled every 10 minutes, they will be processed within an hour and will sit with a tag for next 3 days. Then tag removed and they are ready for new e-mails.
However, while this will work, it's probably not the most efficient way to do it.
To iterate through all customers, you can use the combination of the Custom trigger triggered trigger and the Start custom workflow action from the Flow Companion app. The workflow will look approximately as follows:
At the beginning of the workflow, add a check to ensure that the Specifier starts with the value send email. The Specifier value can be anything that suits you best.
In the Get customer data action, include a condition to check that the customer does not have the processed tag by entering the query condition -tag:processed in the query field.
At the end of the workflow, verify whether the list of retrieved customers contains at least one item. If it does, trigger this same workflow again, passing send email {{ "now" | date: "%Y-%m-%d %H:%M" }} as the Specifier value. The current date is needed to prevent Flow Companion app from activating an infinite loop protection. This way, the workflow will continue running until there are no customers left to process.
You can then schedule this workflow using another workflow, for example, to run once a day:
Thank you for that detailed reply. Its more advanced than I may be able to write myself, I only recently moved from Magento 2 to Shopify, wil give it a go though.
I may have missed it but when does the tag:processed get removed for the next run. Im looking to send an email out say every 3 days at 9am to a particular customer segment which I did a query on, so do I leave that as I've already got;
"metafields.custom.customer_group = 'Re-Seller'"
How is the tag removed once the email is sent ?
@DanLapodo wrote:I may have missed it but when does the tag:processed get removed for the next run.
Thank you for the question. I missed that point in the solution. To remove the tag, you can add the Start custom customer workflow action right after we add the processed tag with the Specifier set to empty processed tag (postponed):
You also need to create a separate workflow that starts with the trigger Custom customer trigger triggered, where you add the tag removing action after 71 hours (so that the mailing can happen again after 72 hours):
This is what I have;
I tried to add the Flow companion to the the Custom trigger triggerd but get an error
If you could simplify possible? How do add the additional query for the tag processed to the GEt Customer data, not sure how to add that with the metafield query that is there?
@DanLapodo wrote:I tried to add the Flow companion to the the Custom trigger triggerd but get an error
I noticed in your screenshot that you created a workflow that starts with the Scheduled to run... trigger. The Flow Companion app cannot start a workflow that begins with that trigger. To make this setup work, you need to start the main workflow with the Custom trigger triggered trigger and create an additional workflow that starts on a schedule and launches the main workflow (see the screenshots in my previous message).
@DanLapodo wrote:If you could simplify possible? How do add the additional query for the tag processed to the GEt Customer data, not sure how to add that with the metafield query that is there?
As Paul_n mentioned above, you can only filter elements by a metafield value if the metafield is indexed. Unfortunately, customer metafields do not support indexing (here is the request I found for adding such functionality). For now, the only option I see is to store the customer’s segment membership in customer tags, for example, by adding the segment-re-seller tag:
If you store the segment in tags, you can filter items in the Get customer data action by adding the following condition to the query field: tag:segment-re-seller AND tag_not:processed.
P.S. You can change tag names and Specifier values as you see fit.
P.P.S. You can also contact Flow Companion support if you have any questions related to private data that you prefer not to share in the community.
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025