Setting up Workflow in SharePoint 2013

https://www.codeproject.com 

Workflow in SharePoint 2013 lies outside of SharePoint.  Meaning there is an entity called Workflow manager which manages workflows in SharePoint 2013.

After installing SharePoint, Workflow needs to be installed and configured separately.  After installing SharePoint 2010 if you open the SharePoint Designer and try to create a re-usable workflow you will see something like this.

image

If you notice the Platform Type is SharePoint 2010.  Only after installing and configuring SharePoint 2013 workflow, you will see that option here.

Hence it is clear that workflow runs outside the process of SharePoint.  It runs in Workflow Manager.  Workflow manager can be installed on a separate server.  The SharePoint WFE has something called as Workflow Manager Client that interacts with WF Manager.  The communication happens using REST APIs and is secured using OAuth.

image

Further clarity can be obtained from “What’s new in SharePoint 2013

 How to set up SharePoint 2013 workflow

  1. Download and install Workflow Manager from this url https://go.microsoft.com/fwlink/?LinkID=252092.
  2. Internet connection should be working as this will download the required prerequisites also.
  3. Configure the WF Manager.  I selected to configure the WF Manager with default settings (Recommended)
  4. Enter database details.  Make sure remote connectivity or TCP/IP and Named Pipes protocols for SQL Server is enabled.
  5. I selected “Allow Workflow Management over HTTP on this computer” (Not to be selected in production)
  6. I selected “Enable Firewall rules”
  7. Enter certification generation key. (You might want to remember this for later)
  8. Proceed and the WF manager will get configured.  After sometime you should see the success screen.

A new web application gets created for workflow.  This is to manage workflow.  It gets created on port 12290 on https and 12291 on http.  You can browse this by going to URL https://localhost:12290/  or https://localhost:12291/ 

As obvious as it is this site would not appear in Central Admin but you can see it in IIS of the workflow server - ‘Workflow Management Site’

image

Workflow is now configured

Configure SharePoint server to connect to WF manager

  1. Install WF Client if Workflow Manager is installed on a different server.  In dev environment if it is on the same box as SharePoint it is not required
  2. Create a new site collection to register the workflow service.
  3. I created with name WFServiceRegisterSiteCollection
  4. Run the PowerShell below

Register-SPWorkflowService -SPSite "https://hydvmtestvm01/sites/WFServiceRegisterSiteCollection" –WorkflowHostUri "https://hydvmtestvm01:12291" –AllowOAuthHttp

Now you can go and create a new workflow in SharePoint Designer and you should see SharePoint 2013 in the Platform type.