Creating and using child workflows in Microsoft Dynamics CRM 2011 can add tremendous value to your already powerful business processes. Child workflows allow users to fire a separate workflow process as an action in any parent workflow. This is especially useful if a company has a large number of existing workflows performing the same subset of steps and actions. The workflows themselves are different, but share a common set of rules or stages in their design. Using a child workflow in this case would allow users to save time in creating new workflows that require these reoccurring subset action groups. Also, editing the actions of this child process would then be done in one place and not in each individual workflow using the common subset.
For example, if a staffing agency wants to send an email to applicants notifying them of a job that is available, they can use a workflow to send email notifications. A child workflow may be used in a case where the job requires a drug screening. Since the drug screening isn’t required for all jobs, using a child workflow would ensure a consistent process for the drug screening notifications as well as be available to use for other similar job workflows. Microsoft Dynamics CRM 2011 only allows you to use a particular workflow as a child workflow if it has the option ‘As a child process’ selected under Available to Run in the Process Properties area.
One thing to remember when using child workflows is the process is asynchronous and the parent workflow will continue on to the next step after executing the child workflow regardless if the child workflow has not completed. Avoid using child workflows if you require a synchronous process.
Microsoft Dynamics CRM contains logic for loop detection to avoid never-ending workflows and unnecessary strain on your server. For situations where a user can accidently create a state in which workflows are stuck in an infinite loop, Microsoft Dynamics CRM uses two tools to detect workflow looping. The system will track a variable called Depth Counter that allows a workflow to execute 8 times (by default) before stopping the process. The depth counter will be reset to zero automatically after a specific period of time using functionality called Time Expiration Boundary. As good practice, users should always revise the workflow carefully before activating and test in a mock environment before activating in your production database.
Learn how to create a workflow reading my previous “Creating Workflows in Microsoft Dynamics CRM 2011” blog.