Hi, would someone kindly take a look at my workflow and let me know where I’m going wrong please. I followed the YouTube video by @MattN " Recursive workflows in Bubble (OR, HOW TO LOOP THROUGH A LIST)" (which was great by the way) and added a final step to start the workflow again 1 day later, once the count of my RG was reached.
The first day works great, but I’ve clearly made an error with the final step as today I received the same emails again.
First two steps are send an email and make changes to a thing. Attached are screenshots of the API workflow, the penultimate step which loops the workflow and the final step where I’d like to run this all again for the updated RG the next day.
My users clients have a few payments each and the email is being sent 3 days before their due dates. My RG is a list of all the clients with payments that are due 3 days ahead. Each payment has a separate entry in the database
Here’s the workflow for the send email and a screenshot of the RG (excuse the lack of styling it’s just for testing) that changes daily and I’d like the workflow to make its way through the RG list and send an email for that day’s outstanding payments, and email will be from the user
So the workflow’s payment_breakdown parameter is a list of Payment Breakdowns…
Presumably, you’re defining that list the very first time you schedule the workflow, right?
But then you’re just passing that same list into subsequent iterations of the workflow, so it will never change - it will just keep running over that same list, as it was defined the first time you scheduled the workflow - which explains why you got the same emails.
If you want to the list of Payment Breakdowns to be different each day, you’ll need to define a new list for each day… preferably at the time the workflow is about to start (if you want it to be as up-to-date as possible).
You just need to redefine it each day in the backend workflow (instead of just using the same list each day).
The best way to do this would be to use 2 workflows…
One that runs over the list, and another that defines the list, triggers the other workflow to run on that list, then reschedules itself to run again the next day.
e.g.
Workflow B
Takes a list of Payment Breakdowns and and index as parameters.
Action 1: Send an email to the ‘index’ item from the list.
Action 2: Make changes to your thing.
Action 3: Reschedule Workflow B to run on the next item in the same list, until the list is complete.
Workflow A
Action 1: Schedule workflow B to run, and define the list for it to iterate over.
Action 2: Reschedule workflow A to run again in 24 hours time.