New Workflow service APIs doesn’t shows the associated 2010 platform workflows to the list. So this will also explain why it is important to migrate the 2010 platform workflow with 2013 even though 2010 platform workflows are supported for background compatibility.
Background
We have migrated one of our SharePoint 2010 site to SharePoint online. We have lots of SharePoint designer workflows associated to our custom lists. Some are approval workflows; some workflows are there just to send emails, some workflows just to break the permissions etc. So these workflows are migrated as it is and they directly supported into SharePoint online since these all are SharePoint designer workflows and no custom code.
In one of the workflow we received one small change and we need to rerun the workflow on existing items. There are total around 3000 existing items so manual run is not an option. So we thought to write PowerShell script.
The following are the high level steps, not sharing complete script here, if required please download from the below URL.
- Create Workflow Service manager instance.
- Get Workflow subscription service.
- Get Workflow instance service instance.
- Load all above instances
- Get all the associated workflows collection by calling method of workflow subscription service EnumerateSubscriptionsByList($list.Id), load the collection object as,
Here, $list.Id is the Id of the list on which we need to start the workflow.- $WorkflowAssociations = $WorkflowSubscriptionService.EnumerateSubscriptionsByList($list.Id)
- $ClientContext.Load($WorkflowAssociations)
- Find the workflow from the associated workflows collection.
- Call the StartWorkflowOnListItem of Workflow instance service.
You can get the complete script from here - PowerShell: Start a workflow for all items in a list on SharePoint Online
Issue
We have opened the “SharePoint Online Management Shell” and started step by step executing the script. We noticed that in the Step 5, $WorkflowAssociations collection we didn’t got our 2010 platform workflows which are associated to the list.
So we didn’t have any option to automate the rerunning the associated 2010 platform workflow to the list except manual starting them.
This becomes challenge for us and this is the main issue. This means new workflow service APIs introduced in 2013 doesn’t contain the API to return the associated 2010 platform workflow and to start/terminate those.
Resolution
Only resolution we found for this problem is to rewrite our 2010 platform to 2013 platform. Then only we could start the workflow on existing items using PowerShell script.
This is one of the reasons why we should consider migrating 2010 platform to 2013 platform.
Important Point to consider
While doing initial migration, we thought we will not rewrite the 2010 platform workflows to 2013 platform since there is no official announcement from Microsoft if they will be deprecated or not or till how long 2010 platform will be supported.
But once we faced this issue then we started rewriting the workflows in 2013 platform.
So key point is start planning those in migration phase only. We must consider rewriting the workflows in 2013 platform while migration phase only.
References:
- What's new in workflows for SharePoint 2013
- Workflow actions quick reference (SharePoint 2013 Workflow platform)

Roshan SalviPosted Aug 7, 2019, 9:42 AM
Is there a script or a way to find the list of SP2010 platform workflows in sharePoint online tenant? We are also looking to rewrite sp2010 workflows in MS Flow, however we dont know exactly which all sites have sp2010 mode workflows created.
Prasham SabadraPosted Mar 21, 2016, 3:39 AM
Thanks!
Vipin TyagiPosted Mar 21, 2016, 3:24 AM
great information Sir.Thanks to share with us.
Rupali ShindePosted Mar 21, 2016, 12:43 AM
thanks for sharing information.
Prasham SabadraPosted Mar 20, 2016, 1:15 AM
Thanks!
Humayun Kabir MamunPosted Mar 20, 2016, 12:02 AM
Nice...
Prasham SabadraPosted Mar 18, 2016, 10:30 PM
Thanks!
Vignesh ManiPosted Mar 18, 2016, 4:51 PM
good one
Prasham SabadraPosted Mar 18, 2016, 10:02 AM
Thanks!
Mohammed IbrahimPosted Mar 18, 2016, 10:01 AM
nice