Chapter 45

Windows Workflow Foundation


  • Learning the different types of workflows that you can create
  • Exploring descriptions of some of the built-in activities
  • Creating custom activities
  • Getting an overview of a workflow


The code downloads for this chapter are found at on the Download Code tab. The code for this chapter is divided into the following major examples:

  • Hello World
  • Parallel Execution
  • Pick Demo
  • Custom Activities
  • Args and Vars
  • Workflow Application
  • Workflow as Services
  • Dynamic Update
  • Designer Hosting


This chapter presents an overview of the Windows Workflow Foundation 4.5 (referred to as WF and Workflow throughout the rest of this chapter), which provides a model to define and execute processes using a set of building blocks called activities. WF provides a Designer that, by default, is hosted within Visual Studio, which enables you to drag and drop activities from the toolbox onto the design surface to create a workflow template.

This template can then be executed in a number of different ways, as explained throughout the chapter. As a workflow executes, it may need to access the outside world, and there are a couple of methods typically used that enable you to do this. In addition, a workflow may need to save and restore its state, for example, when a long wait is needed.

A workflow is constructed from a number of activities, ...

Get Professional C# 2012 and .NET 4.5 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.