I need to send weekly, automated email reminders to a dynamic list of users.
I have decided to send the emails via a recursive workflow. Once all the emails are sent to the users, I schedule the API workflow to restart 7 days later. Fortunately, this works.
My issue…imagine my first round of email goes out on 10/1. Once this workflow is complete, it then schedules schedules the 10/8 email round and loads the list of users. But the list of users is being searched on 10/1, when in reality, I want the list of users to be generated on 10/8. How can I ensure an updated list of users is passed into the API as a parameter?
I’m aware of the recurring feature in Bubble, but the 1 recurring limit per data type on my plan has led me to this approach.
Thanks!
The recurring workflow you’re scheduling could be designed as a “job” or “Task”, rather than on a list of users.
Then when your Job is scheduled and runs, the first action in the workflow could be to schedule an API workflow on a list of users and you do a search for them so they’re always the latest ones. The last action would be to schedule it again the next week.
Interesting! So you’re suggesting introducing an intermediate step/workflow.
Right now, I have workflow A. The very last step of Workflow A is to run Workflow A again in 7 days.
You’re suggesting that the last step of Workflow A is “Run Workflow B in 7 days”. Workflow B only step is to Run Workflow A, with the users parameter. This will ensure an updated users list is always passed to Workflow A.
Am I understanding correctly?
I also have a weekly email mailout, however it’s actually runs every night. Each night it searches only for the users that signed up on the same weekday as the current day… For example, on Tuesdays it would only send email to all the users that joined on a Tuesday.
Not sure this method would be feasible for you but if it is, it’s a handy way to break your lists down into much smaller chunks (especially as bubble may struggle if your list gets to 100k). They send via postmark ‘bulk’ batches of 400 at a time, keeping the WU costs down dramatically compared to sending them individually.
And yes the search is performed as part of that backend workflow so it’s always passing the very latest data to the emails. You’ll just need to trigger it once initially manually. (I also have it update a single “last ran” field just so my system can warn me if it ever didn’t run).
Make that list of users optional as a parameter (I believe I suggested elsewhere for WU purposes to not send a list of users and istead a list of unique IDs as text, so if you adhere to that advice, it is the same concept here to make it optional)…when you have the backend workflow schedule itself again for 1 week later, leave the parameter empty. Add a new step as the first step which is conditionally based on the parameter as empty and that first step is to search for your list of users.
First workflow - processreminders
Takes no parameters.
- Action 1: Schedule API workflow sendreminder on list of Users (the list of users is your dynamic list of users). Set the User parameter to This User
- Action 2: Schedule processreminders to run at Current date/time +days 7
Second workflow - sendreminde
Takes User parameter
- Action 1: Send the email you want to send based on the User parameter
end workflow
No need to have this as a recursive workflow unless you’re running on more than 100,000 users. Save yourself the WU, and improve performance by running as schedule API workflow on a list. Essentially, we have one master job which runs once per week. When run, this schedules a job for each User, and in each job, we process the relevant user.
1 Like
Thanks Matthew! I’m following your logic about passing the empty parameters.
-
I understand the new (conditional) first step would be to search for my list of users. What exact action should I be using here? I figured it would be “Make changes to a list of things” but doesn’t seem to work. Is there a different action I need to use to populate the list of users?
-
You mentioned I should use a list of unique IDs as text for improved performance. Does this mean that I’ll need to perform a search every iteration to return the email address, based on users unique id? If so, does this added search each iteration make it less performant?
Appreciate your help!
Make changes to a list of things will allow you to perform a search as an action. You then need to use the result of that step for subsequent actions that require the list or the first item of the list.
So, if you have an empty parameter on first run, and step 1 is make changes to a list of users, that step 1 will give you the list of users, and then on step 2 you might be sending the email, so you’d do ‘result of step 1:first item’, then in the step 3 if that is where you perform the recursive action to schedule the backend workflow (not the step for scheduling a week later), in that step you can send in the parameter as a list using the ‘result of step 1:items from #2’.
Not performance (I view performance as speed), but for lower WU charges.
Yes
Maybe in terms of speed but not in terms of WU charges.