API Workflow on a List: Changes after Scheduling

Hi friends,

I’m working on something that seems straightforward, but the documentation tells me the behavior I want is not the behavior that will happen. Here is what I want:

  • User schedules an API workflow to send an email to all the Administrators for 1 week from now.
  • 3 new administrators get added during the week
  • Those 3 new Administrators receive the email triggered by the API workflow

According to the documentation, here is what will actually happen:

  • User schedules an API workflow to send the email
  • 3 new administrators get added during the week
  • Those 3 new Administrators WILL NOT RECEIVE THE EMAIL because they were not administrators at the time the original workflow was scheduled.

Does anybody have some tips on how to make the top scenario happen? Thanks in advance!

My best feeling would be to cancel the actual scheduled workflow and re-schedule it with the new time-date, each time a new admin is added.

I would suggest three endpoints - one that you schedule for a week’s time, which calls the second which in turn schedules (immediately) the send email workflow on the list of admins.

Great idea. Thanks for the thought! I knew I was staring a solution straight in the face, but just couldn’t put my finger on it.

1 Like

@louisadekoya @andrewgassen can you please dumb it down for me.

I have a workflow which sends an email on the reminder’s date. I also allow the user to update the reminder’s date and I again schedule api workflow. This leads to multiple emails being scheduled.

Should I cancel the earlier api workflow and then create a new one? Or should I have multiple end points as mentioned above?

Your question seems somewhat different to the OP’s. Yours seems specifically about updating the date that a workflow should run for a given record (whereas the OP, I believe, was asking about new records being added before the (fixed) due date). If I’m correct about your question then I do think you should store the Workflow Id on the relevant record when it is first scheduled and then when the reminder date is updated, cancel and reschedule the workflow. I hope this helps.

1 Like

Hey @louisadekoya, I’m having the same problem! Would you mind elaborating on this a little? I can’t seem to figure this out! Mine is the same as the OP, however my records are being taken out of a list rather than added.

Are you able to share screenshots of your workflows as currently set up?

What would you like to see? I don’t have any workflows currently set up to try to do this because none have worked so I have deleted them.

Essentially, my app sends out surveys, and I’d like to send a reminder to those who have not responded to the survey a couple of hours before the deadline.

When I schedule the survey, a list is created with all users under ‘No Response’. As users respond they get removed from this list.

So, how could I schedule an email in the future (say 2 hours before the deadline) which is sent to only the users remaining on the ‘No Response’ list?

Yes, I was hoping to see your workflows. That way it might be easier to point out what to change, but as I stated in my original comment, one option is to set up three workflow endpoints as follows.

One (let’s call this WF1) to send an email to a given user. You call this, running it on a list, from another workflow (WF2). This list will be a search of your No Response users and the call will be scheduled to run immediately.

The 3rd workflow (WF3) should schedule WF2 to run 2 hours before the deadline. This way the list is passed 2 hours before the deadline and therefore only contains those who have not responded by that point.

Are all 3 workflow’s done on the backend? Or is Workflow3 done on the front-end to schedule WF1 and WF2 on the backend workflow?

Yes, I think you should be able to do WF3 on the front-end, especially if it is a one-off series of workflows or something that you’re happy doing manually. If you want to do all of these steps as a recurring process on a schedule then all three workflows will need to be on the backend and you’ll just need to kick WF3 off once and have it reschedule itself at the desired frequency.

1 Like

Perfect! Totally understood now. Thank you so much!

1 Like