As a presenter at Timisoara .NET Meetup #2 I thought it would be interesting to share with the local community some of my experience with a not so known technology from the .NET stack: Windows Workflow Foundation. For this purpose, I built a demo app (source code available on github) and a short introductory presentation for the topic.
The Rehosted Workflow Designer sample application
The goal of this example is to show how easy it is to implement a lot of powerful functionality with very little code. I created a WPF application which allows the user to design, manage & execute Workflows (plus real time execution logging); I also built a demo custom Activity Library & workflow which, via the activities implemented on top of the meetup.com rest api, returns the list of members that attended the meetup 🙂
Full source code is available on github: https://github.com/orosandrei/Rehosted-Workflow-Designer
About Windows Workflow Foundation
WF was introduced with the release of .NET 3 and it was used in Microsoft SharePoint 2007. Since then, the technology got a complete rewrite with .NET 4.0 which brought great performance improvements and by .NET 4.5 it received many updates which also made it easier to integrate in custom solutions.
When to use WF
Windows Workflows Foundation is a powerful technology and it is very useful when dealing with business logic that changes often, long running processes (nice support for persistence), BPMs (it has great support for State Machines & Flowcharts).
Currently the WF technology is only available for the Windows platform and it doesn’t look like it will be added to the new cross-platform .Net Core anytime soon. The Mono project started porting WF – it is part of its Olive incubation module, however from the github repository commits it looks like it hasn’t received any updates in the last 2 years.
If you really want to execute actions on Unix servers, there is one possibility #hack 🙂 – you could implement an activity that takes as an input a bash script which gets executed on Unix server via SSH; the result of the execution you can return in an Output parameter of the activity.
The future of Windows Workflow Foundation
Sharepoint 2013 & 2016, BizTalk and Dynamics CRM are Microsoft products that make use of WF, so support & maintenance for the latest version is safe in the next years.
From a development point of view, the technology received many updates with .Net 4.5. The latest .Net 4.6 release only added a small feature – FilterResumeTimeoutInSeconds – and in .Net Core WF is not included (yet). Microsoft seems to have shifted its strategy to favor the Azure cloud workflows services & automation development built on top of the Powershell Workflow runbooks (also WF based) and Azure Logic Apps (launched in march 2015).
- Update 3 | October 2016:
- Update 2 | September 2016: work is being done to Port Workflow Foundation to CoreFx/CoreCLR; see https://github.com/dotnet/corefx/issues/2394#issuecomment-171471805 for business case and https://github.com/dotnet/corefx/issues/2394#issuecomment-244534065 for technical challenges
- Update 1 | February 2016: a source at Microsoft reached out and said that WF is not abandoned, but was considered Done and that they are supporting / maintaining it in the future as well; they are also getting feedback from the community regarding what features should be added next
Windows Workflow Foundation
What’s new in WF 4.5
A Developer’s Introduction to WF
Powershell Workflows & Azure Automation
WF 4x Code Samples
.Net Core port of Workflow Foundation Runtime and ETW Tracking
CoreFx/CoreCLR port of Worflow Foundation
* My Rehosted Workflow Designer on github
* My Introduction to Windows Workflow Foundation, embedded below: