Workflow 1: triggered by schedule time, processes 100 customers every 10 minutes, checks their eligibility via run code, and tags them if they are eligible
Workflow 2: triggered by the tag, will send an email, remove the tag, and add another tag that ensures they will not enter the Workflow 1.
We have 10,000 customers.
How do I ensure that the 100 customers processed by Workflow 1 is not the same set of customers process in the previous 10 minutes?
I checked with their AI in Shopify Help, and it says that it might get the same 100 customers repeatedly.
100 customers per 10 minutes is 600 customer per hour – it will take 17 hours to process each day.
That’s a lot.
I’d try to restructure your processing, probably try using Customers-> Segments (as they have their own powerful filtering) and “Customer joined segment” trigger in Flow.
If not, then I’d create 2 flows (sets of flows).
Flow 1, runs scheduled every 10 minutes
checks if date is odd,
then gets 100 customers “not tag: processed-odd”,
removes tag “processed-even”,
runs code, sends e-mail if needed,
adds tag “processed-odd”
On even dates – does nothing.
Flow 2 is the same, but symmetrical:
checks for even date,
gets customers “not tag: processed-even”,
removes tag “processed-odd”,
runs code, sends e-mail if needed,
adds tag “processed-even”.
On odd dates – does nothing.
This way each customer is processed once per day and is prepared to get processed tomorrow.
Another option, if you don’t mind using third-party apps, is to use the “Start custom workflow for list of customers” action from the Flow Companion app on a schedule. This action selects all customers with no limit on their number and starts a workflow that begins with the “Customer: custom trigger triggered” trigger. Each customer will be selected exactly once regardless of the actions of the second workflow. In the “Query” field you can apply a filter to the selection, for example by filtering customers who have not yet been processed by the second workflow in previous runs.
We don’t mind the 17 hours per day. In fact, I am ok with it taking days to process just so Workflow 2 in my post does not send the email at odd hours of the morning like 3 AM.
I would follow your suggestion, but our process is trickier.
I tried segments, but it won’t work with our setup.
For our setup, we have milestones based on birthdays. There are 8 milestones; some are before the birthday, and some are after the birthday. Segments, unfortunately, cannot compute days after a birthday (basically, dates in the future).
For the setup mentioned in my post, each milestone will have 2 flows. This means that in 1 day, there are 8 tagger flows that run.
Does this mean that you are suggesting we use 2 tagger flows per milestone?
I can't suggest anything more precise because I do not know your entire situation.
Would still rather vote for segments though.
The Flow companion gives you additional trigger -- you can create your flow using this trigger as usual and use all usual actions, "Run code" included.
By the way, Flow Companion also provides the “Get current datetime” action that provides the current date and time to the workflow in the UTC time zone. Maybe this will be useful to you since you compare dates in the “Run code” action.
Tim, one more question as I build this, since the segments are based on birthdays, and customers enter the segment based on the date changes, does this mean that my emails will most likely send around midnight?