Last year, I wrote a blog post about wait conditions and process timeouts in Dynamics CRM workflows. While that post covered the basics of making a workflow wait for a specific date, amount of time or action, I will use this post to go into how you can expand on this functionality by using parallel wait branches to create more complex workflows that account for multiple possible scenarios.
For example, imagine that your sales users are required to fill in an Estimated Close Date field on every opportunity that they create in CRM, and you want to automatically create a reminder task for the sales user one week before the estimated close date. However, to avoid confusing your sales users with irrelevant tasks, you need to make sure that the reminder task is not created if the opportunity is won or lost more than one week before the estimated close date.
The key here is that we want the workflow to wait for either of two conditions to be met, execute the steps following the condition that is met and then not execute the steps following the other unmet condition.
The first idea that many users have when faced with this situation is to create a single wait condition that contains a process timeout and a check condition set as an OR group. This is sound logic, however, CRM does not allow a process timeout to exist alongside any other condition; the desired OR group is impossible to create.
Thankfully, the parallel wait branch gives you the tools to construct a workflow that follows that same OR logic without remaining within the properties of a single wait condition. To set a parallel wait branch, all you need to do is add a normal wait condition to your workflow, select that wait condition and then choose the Parallel Wait Branch option from the Add Step menu. The parallel wait branch will appear on the same level as the original wait branch.
Here is what it looks like in CRM:
As you can see, one wait branch is set to wait until the opportunity’s status equals Lost or Won and the other is set with a process timeout that waits until seven days before the opportunity’s estimated close date. Now, all that we need to do is set the actions that we would like to occur for each wait condition. I have set it to stop the workflow if the opportunity is lost or won, and to create the reminder task one week before the opportunity’s estimated close date:
Here are the properties for the Create Task step. You can see that I have set the Due Date field to equal the opportunity’s estimated close date, the Start Date field to the day the task is created (seven days before the opportunity’s estimated close date), and the Owner field to equal the opportunity’s owning user. I have also used the opportunity itself in the Description and Regarding fields:
And that’s it! Once this workflow is activated, it will run for every opportunity that is created and either end with no action or create a reminder task one week before the opportunity’s estimated close date.
This is just one example – you can use parallel wait branches to build workflows that are much more accommodating to a variety of actions and situations than what is possible with a single wait branch.