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:

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
Workflow components in the host process

Interaction between Workflow Components

The following diagram demonstrates how workflow components interact with one another.

Diagram that shows how workflow components interact.

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:

See also