Windows Workflow Overview
A workflow is a set of elemental units called activities that are stored as a model that describes a real-world process. Workflows provide a way of describing the order of execution and dependent relationships between pieces of short- or long-running work. This work passes through the model from start to finish, and activities might be executed by people or by system functions.
Workflow Run-time Engine
Every running workflow instance is created and maintained by an in-process run-time engine that the host process interacts with through one of the following:
A WorkflowInvoker, which invokes the workflow like a method.
A WorkflowApplication for explicit control over the execution of a single workflow instance.
A WorkflowServiceHost for message-based interactions in multi-instance scenarios.
Each of these classes wraps the core activity runtime represented as a ActivityInstance responsible for activity execution. There can be several ActivityInstance objects within an application domain running concurrently.
Each of the preceding three host interaction objects is created from a tree of activities referred to as a workflow program. Using these types or a custom host that wraps ActivityInstance, workflows can be executed inside any Windows process including console applications, forms-based applications, Windows Services, ASP.NET Web sites, and Windows Communication Foundation (WCF) services.
Workflow components in the host process
Interaction between Workflow Components
The following diagram demonstrates how workflow components interact with one another.
In the preceding diagram, the Invoke method of the WorkflowInvoker class is used to invoke several workflow instances. WorkflowInvoker is used for lightweight workflows that do not need management from the host; workflows that need management from the host (such as Bookmark resumption) must be executed using Run instead. It isn’t required to wait for one workflow instance to complete before invoking another; the runtime engine supports running multiple workflow instances simultaneously. The workflows invoked are as follows:
A Sequence activity that contains a WriteLine child activity. A Variable of the parent activity is bound to an InArgument of the child activity. For more information about on variables, arguments, and binding, see Variables and Arguments.
A custom activity called
ReadLine. An OutArgument of the
ReadLineactivity is returned to the calling Invoke method.
A custom activity that derives from the CodeActivity abstract class. The CodeActivity can access run-time features (such as tracking and properties) using the CodeActivityContext that is available as a parameter of the Execute method. For more information about these run-time features, see Workflow Tracking and Tracing and Workflow Execution Properties.
Submit and view feedback for