Workflow definitions defined in an XML file can be executed in one of two ways: through direct execution by the workflow runtime or as compiled assemblies in their own right. To execute a workflow contained in an XML file directly, simply call the workflow runtime’s CreateWorkflow method using an XmlTextReader as a parameter, after first loading the XML into the XmlTextReader. Compiling XML files involves the use of the workflow compiler, wfc.exe. Let’s look at both cases using the simple workflow you see in Figure 16-2.
Figure 16-2. A simple workflow for XAML-based workflow definition experimentation