Flow is all the rage these days but there are some scenarios where classic workflow still rules. Classic workflow has the uncanny ability to readjust itself when underlying data you’re waiting for, changes.
This dialog took place not so long ago:
Steve “Reads his own blog” Mordue: I want to trigger a workflow to update an account record if a case has not been created in the last 30 days for the account. Any ideas?
Yours truly: So let me get this straight… You want to run a workflow when something does not happen. That’s a new one.
SM: Yes
YT: How about this.
- Create a field on account ‘Last case created on’. Have a workflow that fills that in with the current date on case create.
- Have another workflow waiting on that field that kicks in 30 days after the date. It will readjust itself as the field gets updated.
SM: I like it
Just to be fair. If you have bazillions of the accounts and quantamarillions of cases, you might end up with a large number of waiting workflows. Some people have beef with that so those might want to consider Guido “Future olive farmer” Preite‘s suggestion of a scheduled Azure Function to perform the check every day. GP did admit that it was a developer’s suggestion meaning that SM ignored it.
Cover photo by Anthony Ginsbrook
Another viable option, which doesn’t use waiting workflows nor Azure functions, would be to use MS Flow to daily query for accounts that have a gap of 30 days between the last case and the current date.
Are you sure you can build “query for accounts that have a gap of 30 days between the last case and the current date” in Flow? Sounds extremely challenging.
For a single account I suppose you could do top 1 from cases sorted desc by createdon but all of them? Plus you might hit the record limits.
All in all, Azure Functions, Logic Apps, and Flow would all be similar – a process that checks the data on a regular basis.
Ideally not in a single query, no, but in combination with step 1 of your suggestion it would work out well 🙂
Mmmm, not so sure considering the current set of Flow capabilities… I believe it when I see it.
Doable over http request plus azure ad auth plus fetchxml query.
Why would I do it in Flow then? If I have to muck around with http request, azure ad auth, and fetchxml, I might as well go for Azure function.
[…] Run workflow when something did not happen […]