WF 4.0 gives us a completely rewritten workflow engine! Personally I find it a little scary when Microsoft shifts a product around in this fashion fortunately the changes they are making are really promising and might be just what is needed to get the adoption of WF to really take off.
So what are we getting with this rewrite then?
* Fully declarative model it is now possible to write workflows totally composed using XAML.
* We get a new activity execution model that enables activities to have variables for storing data and arguments for passing data in and out from the activity. Basically it looks very much like a regular function signature with possiblity to have locally scooped variables within the function body (altough these variables are visible when walking down the parent/child chain sort of scoped global variables).
* Flowchart based workflows, which lets us get around some of the limitations when doing sequential workflow such as going back in the workflow after something had occured. Ofcourse this was possible to do using a statemachine workflow but not at all as cleanly as a flowchart would do it.
* The re-hosting of the workflow designer has gotten an real overhaul and gone form previously being a major undertaking guided by a 20+ page document to being a 4 lines of code experience.
* Totally rewritten WPF designer.
* Major performance improvments.This is by no means all the stuff available in WF 4.0 but I'll have to get back with further postings after actually having spent some time with the bits. One thing that really bugs me though is the backward compatibilities with previous versions of WF, I'm worried that we will be subject to having to port our code by hand if we have not limited our workflows to strictly XAML based workflows (which isn't that easy to do in the present version).
If you want to get some more details on what's comming check out these session recordings from PDC08:
WF 4.0: A First Look
WF 4.0: Extending with Custom Activities
WCF 4.0: Building WCF Services with WF in Microsoft .NET 4.0