In this tutorial, we will see a few SharePoint workflow examples, and also, we will check some SharePoint designer workflow examples. You will get to know how to work with designer workflow from these sharepoint workflow examples.
Create a document approval workflow in SharePoint 2013
Now let us see, how to create a document approval workflow in SharePoint 2013 or SharePoint Online using the out of box feature.
Here I have a SharePoint document library and I want when a user uploads a document to the document library, it will go for approval and once the document got approved then the document should appear in the document library.
If the approval got rejected then it should not show the document in the SharePoint document library.
Create a document approval workflow in SharePoint 2013
We will use here the default our of box approval workflow which is presented in SharePoint 2013. If you are not able to see all the default workflows when trying to add a workflow in the browser then check out an article on Not able to see all out-of-box workflows in SharePoint 2013 Online Sites.
First, create a document library using the standard document library app template. Here my document library name is “MyTestDocLib”.
Then in the next step, we will enable the content approval for the library. For this Open your library got to the library settings. On the Settings page, click on Versioning settings under General Settings.
In the Versioning Settings page, select the Yes radio button in the Content Approval section. Then in the Document Version History section select radio button “Create major and minor (draft) versions”.
Then in the Draft, Item Security section, select the radio button “Only users who can approve items (and the author of the item)”. Then click OK as shown in the fig below:
After this open the document library to create the document approval workflow. Then From the Ribbon click on the LIBRARY tab and then go to the Settings section on the right side, then Click on Workflow Settings -> Add a Workflow.
This will open the Add a Workflow page. Here Select the workflow template as Approval – SharePoint 2010. Then give a unique name for the Workflow. Then select your Task List, Workflow History list. Then in the Start Options, choose the options on which you want the workflow to be started.
Here select the “Start this workflow to approve publishing a major version of an item” radio button. To allow users to manually approve an item I have selected this radio button also “Allow this workflow to be manually started by an authenticated user with Edit Item permissions“. See the fig how it looks.
Then click on Next. Then on the next screen, it will allow you to assign Approvers, Due date for a task, comments for approvers, etc. So in the next screen customize something like below:
You can put the approver and also you can put some comments on the approver. Make sure you checked the checkbox “End on first rejection”, so that when the item goes rejected it will end there. Then click on Save.
Now the workflow is successfully attached to the document library. You should be able to see like below:
Now let us go to the Document library and upload a document to it. The item will be available to the creator and the person who has permission to manage lists and libraries can see it. For other users, the item will not be available.
When a user uploads a document, an email will be triggered to the person you have configured in the workflow. When a user opens the email, S/He can open the task by clicking on the task title or from the Open this Task button from the Ribbon in the email.
Due to some constraints, I will not able to show you the email, here I am directly opening that task. When you open the task, you will be able to see a screen like below, where you can Approve, Reject, Cancel, etc.
Once you approve the document will appear for everyone who has read access to see the SharePoint 2013 document library.
This is how to create a document approval workflow in SharePoint using SharePoint out-of-box features.
Create SharePoint reusable workflow
In this example we will see is about SharePoint reusable workflow. Let us see, how to create a reusable workflow using SharePoint designer 2013.
SharePoint Reusable workflows are not bound to any particular list, rather you can associate with one or more than one list or document libraries.
We can use SharePoint Designer to create a reusable workflow, apart from reusable workflow we can also create a list workflow and site workflow using SharePoint designer 2013.
One advantage of SharePoint designer 2013 is that now you can Save any workflow (SharePoint 2013 Workflow platform type) as a template and you can deploy that to other sites.
Create SharePoint Reusable Workflow using SharePoint Designer 2013
Now, let us see step by step how to create a SharePoint reusable workflow using SharePoint designer 2013.
Open your SharePoint 2013 site using SharePoint designer 2013, Then from the Ribbon click on the Reusable Workflow button presented in the Ribbon. This will open the Create Reusable Workflow dialog box.
Enter a Name and Description for the workflow. Remember to choose the SharePoint 2013 Workflow from the Platform Type.
This will open the workflow text-based designer, you can add your logic in the workflow. Here I have just added a Log to History List Action to the workflow.
Once you add click on the message link in the action which will open a dialog box to choose the fields from the Current Item. Since it is not attached to any list or document library, not it is a list workflow, only the default columns will appear as shown in the fig below.
Here I have to log the Current Item Title field to the Workflow history list.
In the Transition to the stage, End the workflow. The workflow will look like below:
Now Save and Publish the workflow. After successfully published, the workflow will be available on the SharePoint site to associate with various lists or libraries.
Attach SharePoint Reusable Workflow to a List or Library
Now to associate the reusable workflow to a list or document library, open your list or library in the browser. Then go to the List or library settings.
On the settings page click on “Workflow Settings” under the Permissions and Management tab.
This will open the Workflow Settings page. Here select This List from the Show workflow associations of this type. And then click on the Add a workflow link as shown in the fig below:
This will open the Add a Workflow page. From the Workflow select the Reusable workflow which we have created in the previous section. Give a name for the Workflow. Then in the Start Option select the “Creating a new item will start this workflow” checkbox. see the fig below:
This will associate the reusable workflow with the SharePoint list. Now if you will add one item to the list and then check the History List then the Title of the item has been logged.
Associate Reusable Workflow from SharePoint Designer 2013
You can directly associate with a list or library from the SharePoint designer itself. Open the click on the Workflows from the Site Objects in the designer. This will open the list of workflows presented on the SharePoint site.
Go to the Reusable section and then select the Reusable workflow which we have created earlier.
Then from the Ribbon, Click on Associate to List button as shown in the fig below:
Once you select the list, this will open the Add Workflow page in the browser. Follow the above steps to associate the workflow.
This is how to create, deploy, and associate a SharePoint reusable workflow to list or document library using SharePoint designer 2013.
App Step in SharePoint 2013 Designer Workflow
Here is another SharePoint designer workflow example that explains, App Step in SharePoint 2013 designer workflow.
If you have worked on or if you have used the “Impersonation Step” in the SharePoint designer 2010 workflow then surely you will need this step. Because “Impersonation Step” is deprecated in SharePoint Designer 2013. And in SharePoint 2013 designer workflows, we have to use App Steps.
SharePoint 2013 designer workflow runs under the permissions of the user who published the workflow. But the user may not have permission to do some elevated permissions task. In those cases, if you will not use elevated permissions then the workflow will fail.
In SharePoint 2010 we can achieve this by using the “Impersonation Step”. But in SharePoint 2013 Impersonation Step is deprecated and the alternative to this, we can use the App Step.
Any actions placed inside an App Step will have Read/Write permissions to all items on the site. Unlike the impersonation step, the advantages of the App Step are that we can run the step with elevated permissions at the required position in the workflow rather than having to have the whole workflow.
To use App Step, first, we need to activate the “Workflows can use app permissions” site feature. This feature allows workflows to read from and write to all the items on the site. You can go to Settings -> Site settings.
Then on the Site Settings page, click on “Manage site features” under the Site Actions section. In the “Site Features” page, search for the “Workflows can use app permissions” feature and click on “Activate” if it has not been activated.
SharePoint Designer Workflow App Step Example
In this example, I have one list and when the user submits one item into the list, one item will be created on a different list. In the second list, only a few people will have access. So we have created one SharePoint 2013 list workflow in the first list.
We have used here Create item in a List action. We choose here the second list name and the value of the Title field we are putting in the second Title list Title. See fig below:
So our workflow looks like below:
Here two different users added an item to the list, First user has Contribute access to the second list. When this user added an item to the first list, workflow triggers and completed it successfully. Also, it created one item in the second list.
But when another user added an item to the list, the workflow started but it went to a suspended state. Because the user has only read access to the second list.
Now I have changed the workflow and added an App Step and added the Create Item… workflow section inside the App Step. Looks like fig below:
Now when you publish the workflow, it will ask for a confirmation dialog box like below:
“By publishing this workflow, conditions and actions inside App Steps will run using only application credentials. Only continue if this is the intended behavior“. It looks like below:
Then go to the workflow settings and uncheck “Automatically update the workflow status to the current stage name” like below:
Impersonation step missing in SharePoint 2013 Workflow
Here we will discuss the issue “Impersonation step missing in SharePoint 2013 Workflow“. The impersonation step is the concept of SharePoint 2010 and the workflow action was available in SharePoint designer 2010.
But this action is not available in SharePoint 2013 workflow platform.
A SharePoint designer workflow runs under the permission of the user who started the workflow. But in some steps, the workflow may require the user to have some more permission. If elevated permissions are not used in those steps then the workflow will not work with access denied error.
In those cases in SharePoint 2010 “Impersonation step” was helpful. But in SharePoint 2013 a similar step is available known as “App Step”. Any actions placed inside an App Step will have Read/Write permissions to all items in the site, such as site lists.
Let us say we have a requirement like below:
I have two document libraries and if a user uploads one document to one library, I want the document to be copied to my second document library. But as per my requirement, I can not provide contribute access to anyone except a few people into my second document library. But you need to contribute access to copy item.
In the above kind of requirement, we can use the app step and we can add the copy document activity inside the App Step.
If you are not able to see the “App Step” inside SharePoint 2013 designer workflow then make sure the below feature is activated like below:
- Workflows can use app permissions
If it is not activated, activate it and then open SharePoint 2013 designer. You should be able to see the app step in the SharePoint designer workflow.
Now after this when the user has read access to the second list added one item in the first list, workflow triggers, and completed successfully.
Impersonation step in SharePoint 2010 designer workflow
Let us see another SharePoint designer workflow example. Here we will also see one example of how we can use the impersonation step in SharePoint designer 2010 workflow.
The impersonation step has been replaced as App Steps in SharePoint designer 2013 workflow.
Impersonation step in SharePoint 2010 designer workflow
By default, a workflow runs using the permissions of the user who started the workflow. But suppose you want to delete an item from a list in the workflow. But maybe the user who started the workflow may not have sufficient permission to delete an item from the list. So, in that case, it will give an access denied error message.
So here in this type of situation, we need to use the impersonation step. Impersonation steps run with the permissions of the person who last saved the workflow.
This enables a person running a workflow to perform actions within impersonation steps that their permissions would not otherwise allow.
Below is the way you can add an impersonation step to the designer workflow:
Open your SharePoint workflow and from the Ribbon select Impersonation Step from the Ribbon as shown in the figure below:
The above step will add the Impersonation step section to the workflow like below. In that block, you can add your workflow Actions.
This is how to use impersonation steps in SharePoint designer 2010 workflow.
Create approval workflow in SharePoint 2010 designer
Let us see, how to create an approval workflow using SharePoint designer 2010 in SharePoint 2010. Learn step by step how to create approval workflow in SharePoint 2010 using SharePoint designer.
Create approval workflow in SharePoint designer
I am using SharePoint foundation 2010 and there is no option for Approval workflow as a SharePoint foundation 2010. So here we create the Approval workflow using “Collect data from a user” action instead of “Start approval process” action to complete the approval task for SharePoint foundation 2010. For this follow these steps:
- Open the SharePoint Designer 2010 and connect to your SharePoint 2010 site.
- Click Workflows and select the workflow type you need, for this, I am using reusable workflow with All content types as my scope.
- From the workflow ribbon select Actions “collect Data from user”. See in fig
- This will show you the Action in the workflow editor. See in fig
- Now Clicking on data will allow you to create the custom task by starting the task wizard, open the wizard and click Next.
- You will need to specify a Task name, and you can specify a description. For now, let’s call the task “Review Task”. And click Next. See in fig
- Now you can specify the custom field by clicking add and select the field type, I will specify two field: Approved as a choice with Yes/No and Comment as a text area.
- Now it should be looking like this, with both fields listed. See in fig
- After finishing creating the Task, getting the user as an Approver, Click on this user and select the People/Groups. See in fig
- Now add a condition (if any value equals value) from workflow ribbon.
- Click the first value, and then click Fx, there goes to a pop-up window, enter as below see in fig
- Set another value to “Yes”.
- Now add the action “set workflow status”, Set it to approval.
- Add an If-Else branch, set the workflow status to reject.
- Now see the whole workflow. See in fig
- Publish the workflow, and use it for the approval purpose.
- Now when you associate with a list and add the item in the list the workflow status is in progress. See in fig.
- Now when app-rover approve with select the value Yes (See in fig) workflow status is Approved and if select the value No than workflow status is Reject. See in fig.
This is how to create SharePoint approval workflow 2010 using SharePoint designer 2010.
SharePoint Workflow Errors and Fixes
Let us check out a few SharePoint workflow errors and fixes.
Workflow failed to start cancelled by system account SharePoint 2013
Let us see, how to fix the SharePoint 2013 designer workflow error which shows as Workflow Cancelled: Workflow <name> was canceled by System Account.
Error: <Workflow Name> failed to start.
In the particular case, we have migrated few SharePoint designer workflows from MOSS 2007 to SharePoint 2013. And when we run the workflows in SharePoint 2013, it gives the above error. If you will go and see the workflow status for each item, you will see something like below:
Workflow canceled failed to start
The below solution worked for us.
We saw the workflow was published by the System Account. So we open the designer in another account (full control), just republish the workflow again to the SharePoint 2013 site.
And it worked for us. Basically, we should not publish SharePoint designer 2013 workflow with System Account.
This is how to resolve Workflow canceled failed to start SharePoint 2013 designer workflow error.
SharePoint designer cannot display the item
Let us see, how to fix error, SharePoint Designer cannot display the item in SharePoint 2013/2016/Online that comes when we try to edit a workflow in SharePoint 2013 designer.
The workflows were migrated from moss 2007 to SharePoint 2013 using database upgrade approach. Those workflows were in the 2010 platform.
When I try to edit or view the workflow using SharePoint 2013 designer, it was giving the below error:
SharePoint designer cannot display the item.
We tried opening the same workflow in some other system and it opened correctly.
Then we clear SharePoint 2013 designer cache and it worked for us. Before doing this make sure to close SharePoint 2013 designer.
Delete everything but below folders:
C:\Users\<user name>\AppData\Local\Microsoft\WebsiteCache C:\Users\<user name>\AppData\Roaming\Microsoft\SharePoint Designer\ProxyAssemblyCache
Now Restart the SharePoint designer 2013 and try to open the SharePoint workflow. It should work fine.
This is how to fix the SharePoint Designer cannot display the item error which comes while editing workflows using SharePoint designer 2013.
In this SharePoint designer tutorial, we saw a few examples of SharePoint designer workflows.
- Create a document approval workflow in SharePoint 2013
- Create SharePoint reusable workflow
- App Step in SharePoint 2013 Designer Workflow
- SharePoint Designer Workflow App Step Example
- Impersonation step missing in SharePoint 2013 Workflow
- Impersonation step in SharePoint 2010 designer workflow
- Create approval workflow in SharePoint 2010 designer
- SharePoint Workflow Errors and Fixes
- Workflow failed to start cancelled by system account SharePoint 2013
- SharePoint designer cannot display the item
After working for more than 15 years in Microsoft technologies like SharePoint, Office 365, and Power Platform (Power Apps, Power Automate, and Power BI), I thought will share my SharePoint expertise knowledge with the world. Out audiences are from the United States, Canada, United Kingdom, Australia, New Zealand, etc. For my expertise knowledge and SharePoint tutorials, Microsoft has been awarded a SharePoint MVP(8 times), check out My MVP Profile. I have also worked in companies like HP, TCS, KPIT, etc.