- Interact with Azure Cosmos DB with PowerShell - Tue, Sep 14 2021
- Azure health services: Track Microsoft cloud outages and maintenance - Wed, Sep 8 2021
- Powerline: Customize your PowerShell console - Tue, Aug 31 2021
Consider the following situation: Your human resources (HR) director is up in arms because she has no system in place to automate the submission and processing of paid time off (PTO) requests from employees.
The way the situation works now is (a) the employee submits a PTO request form he or she finds on a file share, and that form may or may not be the correct version; (b) the HR manager receives the completed request forms as e-mail attachments, and some messages invariably slip through the cracks; (c) the signoff managers sometimes "forget" to process the request forms they they receive from the HR manager, leading to (d) disgruntled employees.
Does this fictional case study ring any bells of familiarity to you? The good news is that if you run SharePoint Server in your shop, you can leverage workflows to completely automate business processes like this.
As a matter of fact, that's all a workflow is: a business process that has a defined start state, processing component(s), and an end state.
SharePoint workflow basics ^
First of all, only SharePoint Server 2013 includes full workflow support, so in this article we won't take up the case of SharePoint Foundation. Second, you'll find that SharePoint Server 2013 includes only "SharePoint 2010"-style workflows by default. What's going on here?
Here's the deal: SharePoint 2010 workflows run in the context of SharePoint itself. This means that as your deployed workflows gain increasing use in your farm, the performance of your SharePoint servers can and will begin to suffer.
SharePoint Server 2013 includes five in-box SharePoint 2010 workflows:
- Approval: Routes a document or list item to designated people for approval or rejection.
- Collect Feedback: Routes a document or list item to designated people to obtain their comments.
- Collect Signatures: Routes a Microsoft Office document to people in order to collect their digital signatures.
- Three State: Used the track the status of a list item or document through (surprise, surprise) three states. You can attach this workflow to the built-in Task list template, or use any Choice column field with three choices.
- Publishing: Automates content routing with Web page publication being the desired end result.
The underlying engine of SharePoint workflow is a Microsoft technology called Windows Workflow Foundation. Evidently Microsoft originally called their workflow technology WWF, but the World Wildlife Fund threatened a lawsuit; henceforth, we now call the workflow engine WF instead.
SharePoint 2010 workflows use WF 3.0. For whatever reason, SharePoint Server 2013 does not include Windows Workflow Foundation 4.5 in-box. Thus, we have some downloading and installing to do.
Many SharePoint workflow designers like the free SharePoint Designer 2013 tool to help them build workflows; you can easily see whether your farm uses WF 3.0 or WF 4.5 by attempting to create a new workflow.
By default, only SharePoint 2010 workflows are available in SharePoint 2013 farms.
Getting WF 4.5 up and running ^
Enabling SharePoint 2013 out-of-farm workflows isn't that tough if you know the general (pardon the expression) workflow:
- Nominate the server(s) that will run the WF 4.5 farm
- Download and install Workflow Manager
- Run the Workflow Manager Configuration Wizard
- Attach your SharePoint farm to the Workflow Manager server
Installing one of your existing SharePoint servers as a workflow server defeats the purpose of offloading workflow processing. You can select any Windows Server domain member server as your WF 4.5 farm base.
Download the free Workflow Manager and run the installer. Please note that this is a Web installer, so you'll need an active Internet connection in order to complete this process.
As you can see below, the Workflow Manager Web installer provides direct download links to any prerequisite components that are absent on the current server.
The Workflow Web Platform installer provides remediation for missing prerequisite components.
The Workflow Manager Configuration Wizard kicks off after the Web Platform Installer completes its work. I suggest that you run the wizard using the recommended defaults. As you can see in the next screenshot, you need to have a SQL Server instance available, as well as an AD DS farm service account.
Setting up a Workflow Manager farm requires access to a SQL Server instance.
Notice that we can allow workflow management over HTTP and not have to obtain and install an SSL certificate. Also, we can instruct Workflow Manager to enable the appropriate firewall rules on the local server.
The final step after configuring your WF 4.5 farm is to connect your SharePoint Server 2013 farm to the Workflow Manager farm. Not surprisingly, we do this through Windows PowerShell.
Head on over to a SharePoint server, fire up the Management Shell as an administrator, and run the following PowerShell statement:
Register-SPWorkflowService -SPSite "http://sharepoint/sitecollection" -WorkflowHostUri "http://workflowmgr:12291" -AllowOAuthHttp
In my sample code, the URL "http://sharepoint/sitecollection" points to a specific site collection, and "http://workflowmgr:12291" points to my Workflow Manager farm host. Note that the default TCP port for HTTPS communications is 12290.
That's it! Now we can begin to deploy SharePoint workflows that run out-of-band with the farm and don't impact the performance of our SharePoint web front end or application servers.
Integrating SharePoint Designer 2013 with Visio Professional 2013
Fire up SharePoint Designer 2013, connect to a site collection that is linked to the WF farm, and start the process of creating a new workflow. In next screenshot we see that SharePoint 2013 workflows are now possible.
Now we're cooking with gas!
I'll leave you with one final (very cool) trick: If you have both SharePoint Designer 2013 and Visio Professional 2013 installed on the same computer, then you can take advantage of the Graphical Designer view.
Once your new workflow appears in Designer, navigate to the Workflow ribbon tab, Manage group, and click Views > Visual Designer. I call this interface element out in the screenshot below. This transparent integration between Designer and Visio means that we can use Visio shapes to construct our workflows instead of text-based expressions.
SharePoint Designer 2013 and Visio Professional 2013 are a great platform for building SharePoint workflows.