Workflow and the Parallel Activity

We often see questions from customers about how the parallel activity is not multi-threaded.  If I had to suggest a different name for the parallel activity, it would be “Safely Wait for All Branches to Complete Before Proceeding” Activity.  That's a bit long but more accurate.  The Parallel activity provides a programming construct when modeling business processes with multiple branches that is thread-safe and reliable.  If workflow (or BizTalk) spun up separate threads for each branch, and each branch tried to access the same resource, in addition to potential resource corruption, race conditions or deadlocks could occur that would be potentially beyond Workflow or BizTalk’s control.

Of course, you can achieve parallel execution by using the InvokeWorkflow when the performance demands warrant the additional coding work because separate workflows execute on separate threads. My teammate Kirk Evans has a great blog post that highlights how any asynchronous Activity can be used to achieve parallel execution.   He also shows how to write a custom activity that allows for asynchronous execution as well.  Check it out here.