Sunday, August 05, 2007 6:21:21 PM (GMT Standard Time, UTC+00:00)
Having spoken, taught, and consulted about Windows Workflow Foundation for over two years I've run into a number of common misconceptions about WF.
One common misconception is that WF is a write-once run-anywhere technology. Some people feel like if they write a workflow to run inside of a particular host (let's take SharePoint) - that those workflows will be able to run inside of another host (let's imagine the next version of BizTalk which has already been announced will run WF workflows natively as its "Orchestration" engine). The answer is almost *all* cases is a resounding NO (there are a few small exceptions to this rule but they are hardly worth mentioning).
In WF a Host has to know how to interact with Workflows, when to create them, when to use an existing Workflow Instance, and most importantly how to communication with a running workflow (this is probably the #1 reason why workflows are not portable among workflow hosts).
So a workflow you build today for SharePoint is intended only to run in SharePoint. A workflow you build for a custom Host is likely only to run in that custom Host - it is very very unlikely that you'll be able to take a workflow built for a custom Host and run it in the next version of BizTalk (and I have no inside knowledge of what workflows inside of the next version of BizTalk will look like - although I think you can probably intuit that from what's in Orcas in terms of the WCF-WF integration).
This blog post came to me when I was doing a talk about the BizTalk Extensions for WF a few weeks ago and someone asked about running the workflows I show inside of another host (like SharePoint or the next version of BizTalk). This of course was not the first time I'd gotten that question (or questions like it). But then this idea came to me, because of course when I said "No" the followup question was "Well - then why would I want to invest in Workflow if my Workflows I build today won't likely run in the next version of BizTalk?".
My answer - and the point of this post - is that the atom of reuse in WF isn't at the Workflow/Root level. The atom of reuse in WF is Activities. Even thought a Workflow built for SharePoint won't run in another host - if you build custom activities to encapsulate your programming logic - those Activities will be able to be reused in other Workflows (and likely other Workflow Hosts as well - although there are some exceptions - the most glaring of course is Activities that relate to communication - since that is often the most host specific type of activities).
So any investment you make in WF will pay off in different hosts - both in terms of general knowledge about how WF works - as well as your investment in custom Activities.
WF