This sample application demonstrates how you can create a Workflow Service that will automatically start and periodically wake up to do some work.  The sample also demonstrates a UI that shows the progress of the work and provides control and query capabilities.

Get Microsoft Silverlight
Download video

Building the Sample

This sample requires

You must run Visual Studio as Administrator when opening the solution.

To configure the web application

  1. Run IIS Manager
  2. Right click on BatchWeb and select Manage Application / Advanced Settings
  3. Add net.pipe to the list of enabled protocols
  4. Right click on BatchWeb and select Manage WCF and WF Services
  5. Select the Auto-Start page
  6. Enable Auto-Start for all services

Service Control

The Workflow Service is started by sending a request message.  After the service is started a Parallel activity with three branches ensures that while the workflow service is working it can also respond to Stop or Query control messages.

Auto Start

Workflow Services do not start until a request is received.  If you want to start an instance of the workflow when the system boots or the AppPool is restarted you can do this by creating a Custom Workflow Service Host Factory.  For more information see How to create a WF4 WorkflowServiceHostFactory for AppFabric Auto-Start