Working With WF4 — Windows Workflow Foundation 4.0

Recently, I taught a course in Microsoft .NET Framework Windows Workflow Foundation, Version 4 (WF4) and was surprised to find so much confusion surrounding the adoption of the technology.

As a result, I wanted to add something to the community by way of a “quick adopt” guide. While there are a lot of supporting materials on the web and in bookstores, many are hard to follow, as they are related to the many versions as well as sub-versions of Workflow that we have not experienced before as .NET developers.

This article will help you get past these issues and save you some time in the process.

Windows Workflow Foundation 4.0 Compared to Older Versions

First of all, be aware that WF4 is a much different version than 3.0 and 3.5.

According to Kathleen Dollard in the above linked article:

“The gains are enormous: custom activities take center stage, and authoring them is much simpler; workflows are entirely declarative; and there are three workflow flow styles that you can combine seamlessly. It’s possible that you could see a 10-fold improvement in the time required to create and debug workflows, in addition to 10- to 100-fold runtime performance improvements.”

Most notably, there is no longer a Workflow Runtime object in version 4; workflows are executed directly using WorkflowApplication or WorkflowInvoker instead.

Get The Latest WF4 Project Templates

Because Microsoft added features after the release of Visual Studio.Net 2010, you won’t find the latest project templates in a normal installation. As of this writing (12/2011), you need to download the Design Time Update to make sure you get the latest WF4 features:

Notice that the default templates are very different from previous versions.

Windows Workflow 4.0

Additional Resources for WWF4

Most of what you will find for WF is dated because the information on the web spans versions 3.0, 3.5, the Pre-Release of 4.0, the actual 4.0 release (which didn’t have state machine workflows or project templates as they look now), the platform update 1, release 4.01 and the new release 4.02.

Whew! I’m out of breath.

That said, I’ve already waded through and vetted the following resources, so hopefully the links provided below will save you a lot of time and immediately point you to resources that are available and pertinent.

The first resource is the blog home for the man responsible for most of the useful content on the web as well as much of the drive behind the technology adoption, Ron Jacobs.

(Note — Various project teams and development groups vie for budget based on many factors. As many of you know, online customer interaction is sometimes quite useful to determine how that budget is allocated. Responding to Ron’s posts and interacting on his blog will go a long way to keep his amazing energy and motivation around WF4. Same here at Learn iT!)

I hope you find the following links useful:

Ron Jacobs’ Workflow Foundation Blog Posts

The REAL WF4 Landing Page

Official WF4 MSDN Sample Set

WF4 on CodePlex

Walkthrough: Document Approval Process

Walkthrough Corporate Purchase Process

Walkthrough: Hiring Process

Walkthrough: Visual Workflow Tracking

Walkthrough:  How to: Create an Activity

Walkthrough: Create a Workflow

Walkthrough: Run a Workflow

Walkthrough: Create and Run a Long Running Workflow

Walkthrough: Suspended Instance Management

Walkthrough: WF4 Persistence Tracking and BookMarks

Walkthrough: WF4 Enterprise Variables

Walkthrough: Rehosting the Workflow Designer

Walkthrough: Using a Custom Expression Editor

Walkthrough: Create a Workflow Service with Messaging Activities

Walkthrough: Access a Service From a Workflow Application

Walkthrough: Create a Workflow Service That Calls Another Workflow Service

Walkthrough:   How to consume a WCF Service from a WF4 Workflow

Walkthrough: WF4 Call WCF Service from Workflow Service

Walkthrough: Persistence Example

Walkthrough: Create a Custom Instance Store

Visual Explanation: WF4 Error Handling

WF Glossary

Visual Studio Downloads

I should add that I am very excited about some of the changes down the line – including a more flexible model underneath the WorkFlowServiceHost implementation.

If you have some useful resources to add please by all means post them here!


Bruce Barstow


With over 25 years of programming experience, Bruce Barstow, MCP, MCT, MCSD.Net, MCAD, CTTI has been providing technical training and consulting services in a wide range of technologies including programming, network engineering, internet/intranet, architectural mentoring, project-directed training and messaging solutions.

His early introduction to the computer science field allowed him the privilege of working on several key products including the Space Shuttle’s post fight data analysis system, a prototype military electronic warfare detection software, the National Launch System, the American Launch System and the Soyuz Space program. He is also the author of VB.Net in 60 Minutes a Day.

Bruce currently instructs the following Learn iT! courses:

10267 – Intro to Web Development

10266 – Programming in C#

10550 – VB.Net in .Net 2010 

10263 – WCF

10265 – Data Access Solutions 

10262 – Windows Applications

10175 – Applications for SharePoint 2010

Leave a reply:

Your email address will not be published.

Sliding Sidebar