Running Workflow Services on Windows Azure

Windows Azure might not support the WCF and WF4 hosting parts of Windows AppFabric bit that doesn’t mean you can’t run workflow services on Windows Azure. After all a workflow is just a .NET 4 type and Windows Azure runs the .NET framework. As a result running a workflow service is quite easy once you know how to configure it.   The web.config file The first problem is that the machine web.config of an Azure virtual machine is different than that on a regular machine. As a result, by default, IIS doesn’t know what to do with a WorkflowService type, … Continue reading Running Workflow Services on Windows Azure

Doing synchronous workflow execution using the WorkflowApplication

The WorkflowApplication is a great way to execute your workflows in process. Usually the fact that the WorkflowApplication is asynchronous is a great thing but there are cases when a little more synchronous execution is nice. For example executing a workflow and updating the state of the user interface is much simpler when the WorkflowApplication.Run() doesn’t finish until all work is done. The key to creating a synchronous WorkflowApplication is using its SynchronizationContext. Normally you set this to SynchronizationContext.Current so everything executes on the current UI thread. However this is still an asynchronous call and the Run doesn’t block. Take … Continue reading Doing synchronous workflow execution using the WorkflowApplication

Calling Workflow Services without Add Service Reference

Sometimes you just don’t want to do an Add Service reference in the client application but still be able to to call a WF4 workflow service. The good thing is that a WF4 workflow service is just another WCF service from the client perspective so almost everything you can do with a regular WCF service you can also do with a workflow service. And calling the service without doing an Add Service Reference first is one of those things. In these examples I am going to use the default workflow service template just to make it easy to get started. … Continue reading Calling Workflow Services without Add Service Reference

Windows Workflow Foundation futures and database access

Ron Jacobs showed a number of really cool new workflow features we can be expecting in the next version of Windows Workflow Foundation during the last PDC in Redmond and Tech-Ed Europe in Berlin. One of the new features he demonstrated where the activities we can use to load data from a SQL server database into our workflow. Most of the new features are really cool but the database activities are not.   Why don’t I like the new database activities With the new ExecuteSqlQuery<T> we are back to typing in a literal SQL string to be executed on the … Continue reading Windows Workflow Foundation futures and database access

Throttling workflow services in WF4

Windows Workflow Foundation 4 makes it real easy to create workflow services that do long running work on a server. However when we are doing long running work there could be an issue with lots of workflows being started and too many workflow instances competing for the same data and threads thereby causing problems like database timeouts or thread pool starvation. To simulate a busy workflow service I have the following sample workflow: The workflow service is started using a WCF request, returns a response, prints a start message, does some work and prints a message that it is done. … Continue reading Throttling workflow services in WF4

Versioning long running Workflow Services in WF4, the code

In my previous WF4 post I described the principal of how to version workflow services using the WCF 4 RoutingService. In that post I described the general problem and solution without going into a lot of detail and showing any code. In this blog post I will add an actual implementation you can use for reference purposes.   The basic layout The solution has three parts. The workflow service with 2 different versions of same workflow. The second version of the workflow has more activities in the tree so it can’t load workflow instances from version 1. Each workflow is … Continue reading Versioning long running Workflow Services in WF4, the code

Versioning long running Workflow Services in WF4

One of the problems with the current version of Windows Workflow Foundation is how to handle different versions of your workflows. With short running workflows this is no big deal, workflows do whatever they are supposed to do and finish, and you can deploy a newer updated version of your XAMLX files whenever you want. Provided the public facing SOAP interface doesn’t change no one will notice a difference and everything will work just fine. However as soon as we get into long running workflows and the SQL Workflow Instance Store things get quite a bit more complicated. As soon … Continue reading Versioning long running Workflow Services in WF4

Limiting which user can access service using the Windows Identity Foundation

In my previous blog post I demonstrated how to secure a workflow service using the Windows Identity Foundation. With this in place we only allow users that are trusted by the STS Dominick Baier wrote. That is nice but in some cases we might not want all users to be able to perform all actions.   How can we check for individual users against a specific action? Using an STS we don’t get the user credentials from the client application but we do get a lot of information in the form of security tokens from the STS my means of … Continue reading Limiting which user can access service using the Windows Identity Foundation

Securing a Workflow Service using Windows Identity Foundation

The way security is often still handled these days with each application keeping track of their own users is somewhat dated. Some form of Federated security, where a single separate server is responsible for the security of a whole series of applications, is the way to go. On the internet there are plenty of examples of this with applications using things like OAuth and leaving their security to others. In windows the preferred form of federated security is through Windows Identity Foundation and it is real easy to secure an ASP.NET site or WCF service using Windows Identity Foundation.   … Continue reading Securing a Workflow Service using Windows Identity Foundation