I was looking for a way to implement “timeout until” in Microsoft Flow, and, although there seem to be a way to do it, there is at least one caveat.
First of all, here is the problem. Let’s say I wanted to send a notification email (or assign a case to somebody) on the Follow Up By date:
In the classic workflows, I would set up a workflow like this:
Once the workflow reaches that step, it would be postponed until the follow up date:
Where it becomes interesting is what happens if I update that date on the case:
Looking at the same workflow session, I can see that new date has been reflected there – exactly the same workflow session is now postponed till Nov 11:
Which takes case of a lot of “date-based” notification scenarios.
Can we do it with Microsoft Flows? Well, sort of. There is “delay until” in Flows, so a Flow which seems similar to the workflow above might look like this:
Looks good? Let’s move follow up date to the 15th of November, then.
The classic workflow is, now, waiting for the 15th:
The Flow is still waiting till the 12th, though:
Although, since the Flow is configured to start on the update of the “Follow Up” date, there are, actually, two Flows running now:
Once of those flows is waiting till the 15th, and another one is waiting till the 12th.
There are, also, multiple workflow sessions running (for the same reasons – every update/create would start a session):
The difference between those is that “delay until” conditions in the Flows are not updated with the modified date value, so each of those Flows is waiting for a different date/time, but all classic workflows have picked up the new date and are, now, waiting for exactly the same date/time.
Having multiple Workflows or Flows trying to take the same action against the record might be a bit of a problem either way (unless it does not matter how many times the action happens), but, more importantly, where classic workflows will run on time as expected, each Flow might be taking that action at different times, and the “context” for the action might be different. For all we know, that “follow up date” may have moved by a week, but some instance of the Flow will still be using original follow up date.
In theory, I guess we could add a condition to the flow to ensure that the flow should still be taking an action – possibly check if the planned time is within a few minutes of the current time:
There is, also, a 30 days limit for the flows, so this may only work in the short-term reminders.
For everything else, it seems we should start using the “recurrence” trigger – on every run, we would need to query the list of records that are past the “due date”, then use “for each” to go over all those records and take actions. Although, if we wanted those actions not to be delayed by a few hours, we would likely have to use a few recurrence triggers (for example, to have the flow started every hour). Or, for the time being, we might probably keep using classic workflows in this kind of scenarios, though this would not be the recommended approach.
Maybe an unrelated question reg Workflow “TimeOut Until”.
In the example above, what if the Case was resolved before the ‘Follow-up’ by?
Or more specifically, how do you delete an instance of a workflow that is in ‘waiting’ stage?
Hi Shidin! Not sure there are better options, but, normally, I would just add another condition to check the status once the “timeout” is over