Share via


Creating and Running a Workflow Instance

This topic applies to Windows Workflow Foundation 4 (WF4).

This sample shows how to run a workflow instance. It shows how to execute it synchronously and asynchronously.

Demonstrates

WorkflowInvoker, WorkflowApplication.

Discussion

The first part of the sample uses Invoke. This is the most basic way to execute a workflow. Workflows executed with Invoke are executed synchronously.

The second part of the sample uses the WorkflowApplication class. WorkflowApplication enables you to have more control over each instance, including the ability to interact with the running workflow and to run the workflow asynchronously.

Ee834514.Important(en-us,VS.100).gif Note:
The samples may already be installed on your computer. Check for the following (default) directory before continuing.

<InstallDrive>:\WF_WCF_Samples

If this directory does not exist, go to Windows Communication Foundation (WCF) and Windows Workflow Foundation (WF) Samples for .NET Framework 4 to download all Windows Communication Foundation (WCF) and WF samples. This sample is located in the following directory.

<InstallDrive>:\WF_WCF_Samples\WF\Basic\Execution\CreatingWorkflowInstances

See Also

Concepts

Using WorkflowInvoker and WorkflowApplication