Windows Workflow Foundation (WF) is a Microsoft technology that provides an API, an in-process workflow engine, and a rehostable designer to implement long-running processes as workflows within .NET applications. The latest version of WF was released as part of the .NET Framework version 4.5 and is referred to as (WF45).
A workflow, as defined here, is a series of distinct programming steps or phases. Each step is modeled in WF as an Activity. The .NET Framework provides a library of activities (such as WriteLine, an activity that writes text to the console or other form of output). Custom activities can also be developed for additional functionality. Activities can be assembled visually into workflows using the Workflow Designer, a design surface that runs within Visual Studio. The designer can also be hosted in other applications.
Encapsulating programming functionality into the activities allows the developer to create more manageable applications; each component of execution can be developed as a Common Language Runtime object whose execution will be managed by the workflow runtime.
Workflow Foundation versions
Workflow Foundation was first released in Version 3 of the .NET Framework, and primarily uses the System.WorkflowActivities, System.Workflow.ComponentModel, and System.WorkflowRuntime namespaces. Workflows in version 3 were created using either the Sequential model (in which activities are executed in order, with the completion of one activity leading to the next), or the State Machine model (in which activities are executed in response to external events). Microsoft SharePoint 2007 uses WF 3. In .NET Framework 3.5, messaging activities were introduced that integrated Workflow with Windows Communication Foundation (WCF). With the new ReceiveActivity, workflows could respond to incoming WCF messages. The new features of Workflow in version 3.5 use the System.ServiceModel namespace. Microsoft SharePoint 2010 uses WF 3.5. In .NET Framework 4, Windows Workflow Foundation was updated extensively, with new features such as Data Contract Resolver, Flowchart, and other flow control activities added. Workflow in .NET 4 uses the SystemActivities namespace. Most notably, there is no longer a Workflow Runtime object in version 4; workflows are executed directly using WorkflowApplication or WorkflowInvoker instead. Activities created in previous versions of the .NET Framework can be executed by .NET 4 workflows using the Interop activity. Future versions and releases of Windows Phone will include an updated State Machine and Dynamic Update.
Workflow usage scenarios
Windows Workflow Foundation is used to create applications that execute an ordered business process, such as the steps needed to approve a document, hire a candidate for a position, or make a purchase. These processes can execute in a short amount of time, but are typically long-running, in which the application will need to shut down to conserve memory between steps. Typically, business processes to be modeled as workflows have the following features: Have specific business logic that may need to change periodically, such as the tax or shipping calculation needed to determine the purchase price of an item, or the series of steps needed to approve a purchase, hire, or process. Have several inputs into the workflow that may come hours or days apart Have advanced business logic that might require workflow execution to travel down different branches depending on different circumstances. Need to interact with other systems, such as a database, website or other client application, or web service.