Introduction to Workflows
SharePoint is often used by enterprises as their intranet (websites, portals used by employees within the organization). And of these applications/sites, one of the most important functionality is, to be able to set up some approval process, tracking system or automation of office process. Such as expense approval, leave approvals, document approval etc. These applications require predefined steps to be performed every time and notify concerned people. This is where workflows come in handy.
What is a workflow?
It is a set of predefined steps (kind of flowchart), which execute one after the other depending on user’s input and setup rules.
We can also say workflow is the automation of a business process, where human input is required. These workflows could run for mins, hours or days depending on the scenario.
It is very important to understand the Business Process we try to automate, without the manual steps clearly understood, it is impossible to automate
SharePoint Workflow Journey
Before we begin with the various aspects of SharePoint workflows, I would like to give a brief of how workflows and background stuff have evolved over time. We all like a bit of history, isn’t it?
Workflow went a major architectural change with SharePoint 2013. From SharePoint 2013 onwards, we have “Workflow manager”. We can treat it as a workflow engine, which is built separately whereas SharePoint 2010 workflow was built into SharePoint. So, if you install SharePoint foundation, you only get SharePoint 2010 workflows. You must install SharePoint server and install and configure Workflow manager to be able to create or run SharePoint 2013 workflows.
Workflow hasn’t changed in SharePoint 2016 or Online. Only that in SharePoint Online, you don’t have to worry about Workflow Manager as everything is taken care by Microsoft.
Out of the box:
Microsoft provides a bunch of workflows by default, these are often called out-of-the-box workflow templates. These workflows can be configured and used without any development effort. Below is the article I will explain these and explain other workflow terminologies and concepts along the way.
SharePoint also allows us to build our own custom workflow templates, which can be then imported or deployed into SharePoint. These can be built using SharePoint Designer, Visual Studio, and some other Microsoft office tools. But that is not the main intent of this article.
Using out of the box workflows
Activate workflow feature
To use out of the box workflows, we need to activate the related feature. Below is the list of workflows and the related feature. Some features are already activated with some site definitions and some need to be activated explicitly. These features are present at the Site Collection scope.
We can reach them at site setting > site collection features
|Workflow name & Related feature|
We should ensure the feature is also activated for SharePoint 2013 and above versions. Without this feature, we will not be able to create workflow tasks in SharePoint 2013.
Add available out of the box workflows
On activation of features above workflow templates become available to be added to a list. If we go to list settings > Add workflow we can see the available out of the box workflow templates.
By default, SharePoint foundation comes with only one workflow template i.e. the Three-state workflow. But with SharePoint server version we get many workflow templates, which help us manage documents in SharePoint.
Just like a list template (a blueprint of a list) or a site template in SharePoint, we also have workflow templates. We saw in section 1 above that some site collection scope features were activated to add workflow templates. Similarly, for custom workflow templates we can attach them to features, which can be activated at the desired location.
What can be done with Out of the box workflows?
Description and usage
Approval – SharePoint 2010
|Approval workflow allow us to set up an approval mechanism on documents in an organization.
It can be set up by simply adding it to a list, library or content type and settings can be made for various steps like, who will approve, how many approval steps will be there and how will it trigger.
Collect Feedback – SharePoint 2010
|This workflow can be used to automate the feedback process on a document. Now we can send a document for feedback from people. All they need to do is complete a task assigned to them.
However, the feedbacks are stored in a list and not the document itself.
Collect Signatures – SharePoint 2010
|Like the collect feedback workflow, this can be used to collect signatures. However, it can be used with office documents that contain Office signature line controls.|
|This workflow can be used for document lifecycle management. It allows users to review a task and take a decision on whether to retain or delete a document.
This workflow can be in association with ‘Information Management Policy’, by creating a Retention Policy, which triggers this workflow.
|This is workflow is designed to be used on Publishing sites, where a publishing page goes through approval or review before it is finally published to the audience. It is just like any other approval workflow.|
|Three-state workflow can be implemented for any process which has three states and two transitions in between. An example could be an incident management system, where incidents are assigned to the IT team, which can have statuses such as Created, Work in Progress, Completed, where we can configure the transitions.|
There are some terminologies which are worth mentioning for a better understanding.
When we add a workflow template to a list, library or content type, a workflow association is created in the background. This workflow association object has reference to a task list and a history list. We can add multiple workflows or same workflow multiple time (with a unique name) to the same list and a workflow association object gets created for every addition.
Workflow association form:
While associating/adding a workflow, we need some configuration information from the user setting it up. Say for example in Three-state workflow, we would like to know the approvers at various stages, and this information might vary for every association. Workflow association for is used for that, out-of-the-box workflows come with it, and we can also create them for custom workflows we develop.
Workflow association column:
When we add a workflow to a list or library a column gets added, which is used by workflow for keeping the status of the workflow. It is of significant use to end users for tracking a workflow instance.
A workflow added to a list runs on every item of the list based on the trigger condition (item created, item edited or manually). This is called a workflow instance of the same workflow.
Workflow task list:
When we add a workflow to a list, library or content type. We are prompted for linking a task list. This task list contains all the tasks created during the execution of the workflow at various steps or transitions. A task is nothing but a piece of work assigned to a person and seeks input or action from the assigned to person.
Workflow history list:
Similar, to a task list, we also configure history list while adding a workflow. It is like logs for the workflow and stores information about various actions performed by the workflow. This can be very useful when debugging or troubleshooting workflows.
Workflow initiation form:
There can be a scenario where we need inputs from the user at the beginning of the workflow, initiation form is designed just for that. When we develop custom workflows, we can design our own initiation form which can be shipped with workflow template in a solution.
SharePoint workflows is a vast topic, there is so much to write such as SharePoint designer workflow and development of custom workflows, but maybe in some other article.
Main intent here was to help you understand the workflows, technical terms associated. When to use and some insights on what is already available. Hope this article might be useful making an informed decision when you want to automate a business process.