Help with looping a workflow 🤞

Continuing the discussion from Help with looping a workflow:

I previously posted about this but was never able to execute it, so hoping someone will be able to kindly help me again…

Each day I have a RG that updates with a list of people who an email should be sent to. I press the button to started the workflow that creates an email for each person in that list.

What I would like to do is now automate that process so everyday emails are created for the new people in that list…without me needing to press the button.

The first workflow that is triggered is the following:

This then triggers the following:

Which finally sends the email 2 days later:

Any help to get this process automated is extremely appreciated!

Many thanks
Lisa

You just need 2 recursive workflows for this…

1 that runs every 24 hours, and defines the list of people to email that day.

And the second one (triggered by the previous one) that sends an email to each Bride in that list.

Hi Adam, thanks so much for replying again. Every time I tried to do it it kept sending to the same blooming email addresses.

The one that runs every 24 hours…that would be a scheduled api workflow, that’s triggered by a click of a button?

Every time I tried to do it it kept sending to the same blooming email addresses.

That’s because, as I recall from your previous post, you were just using the same list to email every day, rather than a new list each day…

The one that runs every 24 hours…that would be a scheduled api workflow, that’s triggered by a click of a button?

Both workflows are just standard API workflows… and yeah… you’ll need to trigger it initially to begin from a button click (or any other event).

The first workflow (Workflow A) just has 2 actions:

  1. Schedule Workflow B for the current/date time
  2. Schedule workflow A for the current date/time plus 24 hours

When scheduling Workflow B you need to define the list of users to email that day, and pass it as a list parameter.

Workflow B just runs through that list and does whatever actions it needs to do. i.e.

  1. send the email to the user
  2. whatever other actions you need
  3. more actions…
  4. more actions… etc.
  5. last action - schedule itself to run again at the current date/time plus a few seconds - but only until all users in the list have been emailed.
1 Like

Thanks for this. Will give it another try today :crossed_fingers:

1 Like

@adamhholmes me again asking for your guidance, sorry!

This is how I’ve set it up…have I put workflow a in the correct place to ‘define the list of users to email that day’?

Thanks in advance

Yes… although it doesn’t actually matter where you put it in the workflow action sequence, if that’s what you’re asking.

I’m not sure I understand what the ‘Iteration’ parameter is for?.. but it it makes sense to you then it’s all good.

Have you managed to get this working yet?

Oh the iteration bit is it starting from 1 so workflow b works through the list of items.

Second day today of the loop and ended up with the same ‘bride’ as yesterday. I can’t seem to define the list for a new day. I’m always just running workflow b for the list of people on the day I start the whole process. Can’t seem to figure this one out

How are you defining the Bride in the workflow?

Via a RG (if I’ve understood that correctly).

The workflow that sets it off every 24 hours, should that be in the backend workflow or next to the initial workflow?

There are no RG’s in backend workflows… so I think you’re misunderstanding something basic here…

When you trigger the second workflow (the one that loops through the list of Brides), you must be passing a list of Brides into a parameter (presumably).

Based on the problem you’re having, it’s almost certain that your just passing that same list into the workflow every day - rather than defining a new list each day as you should be.

Maybe share a screenshot of the rest of your backend workflow (the action that schedules workflow B)…

I’m so sorry I’m not getting this! I really appreciate your help.

I hope this explains it…but if not then I can do a loom…


Should I be using the ‘search’ data in the workflow rather than an RG? Is that how I define the list 24 hours later?

This might be helpful at least as a visual

This would be backend workflows

1 Like

Yes, exactly…

Each day (i.e. each repetition of workflow A) you need to do a fresh search for the events for that day (meaning events scheduled for 9 days time) just as you are in your RG…

So when you schedule workflow B (from within workflow A) the list of Events you pass into the event parameter should be a fresh search each day - that way, every day when workflow A triggers workflow B, the list workflow B is running on is different, and relevant to the current day.

(Otherwise you’re just perpetually re-using the initial search from the repeating group, which will remain on the same day forever…)

2 Likes

Thanks for bearing with me on this! It makes sense now and can’t believe I couldn’t see it before :crazy_face: appreciate your help :raised_hands:

1 Like

Thank you for this visual, makes great sense :raised_hands:

1 Like

If you need more help I can create a simple working example… but I think you’ve got it now…

This topic was automatically closed after 70 days. New replies are no longer allowed.