HttpWorkflowResource is an internal part of the hosting infrastructure for HTTP Workflow Services. It is actually a WCF WebApi Service which is configured to receive all requests for a given BaseAddress. It is created by the HttpWorkflowServiceHost.GetInstance which invokes a ctor providing the class with access to the request message. It maintains a cache of WorkflowApplication instances which may be resumed later depending upon the idle timeout settings.
[WebInvoke(UriTemplate = "*", Method = "*")]
public HttpResponseMessage InvokeWorkflow()

Runtime Execution

When a message is received
  1. It locates the HttpReceive activity with the matching UriTemplate
  2. It then attempts to correlate the request to a matching workflow instance. If no correlated instance is found an CanCreateInstance == true it creates and caches a new workflow instance
  3. It locks the instance to prevent concurrent access and runs the workflow until it becomes idle with the bookmark for the UriTemplate
  4. Resume the bookmark which will invoke the HttpReceive activity and wait for the HttpReceive to set the response
  5. Return the response created by the HttpReceive activity. The workflow may continue processing after the response is sent.

Open Issues

  • How long to cache idle WorkflowApplication instances
  • What happens if a workflow goes into an endless loop after the response is sent? Could/Should the host do something about this?

Last edited Aug 29, 2011 at 9:22 PM by ronjacobs, version 1


tonkonogy Apr 12, 2016 at 2:49 PM 
Has WF Rest been abandoned? last update was about 5 years ago