Ex: If particular workflow is running for longer than specified time then we need to send a notification to concern team.
This solution helps Production Support fellows a lot. They escaped from being a watch dog.
Let's Chat: There are several approach for this and unfortunately every approach has some drawback. It's totally depends upon your requirement that with which drawback you are good or which approach is getting approval from Solution Review Meeting. :-(
Scenario is crystal clear and yes, we need Timer task to handle this but we have to look after about few case so, let's talk about case first.
CASE 1: If workflow (Sessions) exceeds it's specified time of running send a mail.
CASE 2: If workflow (Sessions) completed within specified time then we need to stop timer
Create a Timer in concurrent manner so, that timer starts immediately after starting workflow. (See Image Below)
Set Relative time
DAY HH MM
0 1 30
Note: Expected time to complete workflow is 1:30 Hrs from time of starting.
Create a Email Task.
Email User Name: 24*7 firstname.lastname@example.org
Email Subject: Workflow is going beyond our control
Email Text: Wake Up, Dude. It's your turn now.
Create a Control Task at the end of your workflow execution pipeline. (See Image Below)
Set Control Option: Stop top-level workflow
Note: To test this solution please, reduce the time of timer keep lower than time taken by workflow to complete.
Drawback of Approach: Your Workflow and Timer Status will be as Stop not as Succeeded, if workflow completes within specified time.
Do you want me to explain another approach also, which we have opted in our project? If yes, then leave me a comment :-) ha ha ha, It seems now I have started blackmailing... No need to do this my friend, I am working on that approach also and will post it soon. I want your comments through your heart not from your mind. Thanks.
Feel free to post your doubt in comment section.
Due to limitation, I can't attach exported .xml file which you can Import in your repository and see or analyse. (Feel free to mail me if you need .xml file with Scenario number and Question.)
If you like the approach and solution feel free to share with others.