Should I use the WCF/WF template or implement WF in the implementation for WCF? RRS feed

  • General discussion

  • I am looking to implement my first Windows WF solution and therefor new to it. This will be hosted as a WCF service and I see there is a template for this, but it seems to be tightly coupled to the service. I would like to implement a standard WCF interface where the service is loosely coupled from the implementation. I am wondering if it makes sense to just use the standard WCF service template and call into an implementation library that implements WF rather than the WCF/WF template?
    • Edited by BillyM2010 Friday, July 27, 2012 10:34 PM
    • Changed type Tim Lovell-Smith Monday, July 30, 2012 7:03 PM there's no single right answer :)
    Friday, July 27, 2012 7:18 PM

All replies

  • Hi,

    I think they are two different scenarios:

    1. Host workflow as a service

    We can expose WCF service operations in a workflow by using message activities. Actually, we can create workflow services declarative(the template does) or imperative, encapsulate the implementation of one or multiple service operations in a custom activity and etc.

    2. Host workflow in a WCF services

    It means we must manually host the workflow in WCF services. Generally, we wouldn't hos a long running workflow in WCF services.

    Workflow Services


    Hope this information helps, thanks.

    Leo Tang [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Sunday, July 29, 2012 9:41 AM
  • Further to what Leo said...
    Hosting WF as a service directly works well with appfabric as your host, and you can still use some WCF extensibility points with it same as with a WCF service (in case that is why you care). Also the Receive/SendReply activities work well this way.

    Hosting WF inside of WCF in its simplest form is basically exactly the same thing, but
    a) more work for you in terms of explicitly managing WorkflowApplication objects if you want to run long-running workflows.
    b) you will probably end up not using Receive/SendReply activities, and instead using your own custom bookmarking activities. This could possibly be an attractive proposition for you if you're rather implement your own custom correlation scheme instead of using WF as a service's built-in correlation.


    Monday, July 30, 2012 7:02 PM