How to deploy SharePoint designer workflow into production

In this SharePoint designer workflow tutorial, we will discuss, how to deploy sharepoint designer workflow into production or how to copy workflow from one site to another SharePoint 2013.

YouTube video

Deploy SharePoint designer workflow into production

Before moving the workflow from one site to another site, you need to remember below things else you might see some issues and the workflow might not be deployed properly.

  • Your workflow may have associated with few other lookup lists, make sure all the lists with should be presented in the destination site.
  • All the list names and URL (workflow history list and task lists and associated list) the URL and title of the list should be exactly the same. For example, if your source list contains a space in URL or title, then the destination list should also contain the space.

Here below are my source and destination SharePoint online site.

https://onlysharepoint2013.sharepoint.com/sites/Bhawana/ (Source List)
https://onlysharepoint2013.sharepoint.com/sites/SharePointSky/ (Destination List)

My source list contains a list as “DemoWorkflowList” which has a workflow associated with it. We will deploy the workflow to the destination list.

  • Associated List: DemoWorlkflowList
  • Workflow History List: Workflow History
  • Workflow Task List: Workflow Tasks

Similarly, if you have any other lists used inside the list, you have to create all those lists in the destination SharePoint Online site.

See the lists associated into the workflow.

How to deploy sharepoint designer workflow into production
How to deploy sharepoint designer workflow into production

Copy workflow from one site to another SharePoint Online

The 3 steps are involved in copying workflow from one site to another site.

  • Save the workflow as a template
  • Upload and activate the solution
  • Activate the workflow feature

Save the Workflow as a template

Open the SharePoint Online source site using SharePoint designer 2013. Then from designer click on Workflows in the Site Objects which will display all the workflows in the site.

Select the workflow and click on Save as Template button from the ribbon like below:

copy workflow from one site to another sharepoint 2013
copy workflow from one site to another sharepoint 2013

The template will be saved to the Site Assets gallery. You can see a confirmation message like below:

sharepoint 2013 copy workflow to another list
sharepoint 2013 copy workflow to another list

Upload and activate the solution

Open the Site Assets library (you can open in the browser or you can also open in the SharePoint designer 2013 itself). Here I have opened in the designer itself. If you can not see the template then just click on the Refresh icon in the designer itself.

Then select the template and then click on Export File, which will export the file to your local drive.

how to move list workflow of sharepoint 2013
how to move list workflow of sharepoint 2013

You can see a successful message like below:

copy workflow from one site to another sharepoint online
copy workflow from one site to another sharepoint online

Now the file is in the local drive where you saved the file.

Now Open the SharePoint online destination site, and then go to the Site Settings page. On the Site Settings page click on “Solutions” which is under “Web Designer Galleries“.

Click on the Upload button and then browse to the wsp file which we have saved in the local drvie. Once it is upload, it will show you to activate the solution.

sharepoint 2013 move workflow to another site
sharepoint 2013 move workflow to another site

Once you click on activate, you can see the solution get activated like below:

save workflow as template sharepoint designer 2013
save workflow as template sharepoint designer 2013

Activate the Feature

Now go back to the Site Settings page of the destination site again and then click on “Manage site features” which is under “Site Actions“.

There search for a feature with the same name.

Example: Workflow template “ListNotificationWorkflow” from web template “Bhawana: and activate the feature. It should look like below:

sharepoint designer 2013 export workflow
sharepoint designer 2013 export workflow

If the feature got activated successfully then, you can see the workflow will be attached to the list properly. I can go to the list and can find it properly like below:

how to migrate sharepoint designer workflow
how to migrate sharepoint designer workflow

You can also open the site in designer and you can see it properly like below:

how to deploy sharepoint designer workflow into production
how to deploy sharepoint designer workflow into production

The workflow will also work as expected.

Error while activating feature

But sometimes while activating feature you might get an error like below:

Sorry, something went wrong.
Microsoft.Workflow.Client.ActivityValidationException: Workflow XAML failed validation due to the following error:
Failed to create a ‘ListId’ from the text: ‘$ListId:Lists/ListName’: HTTP headers received from the server – ActiviyId:’GUID’……………. —-> System.Net.WebException: The remote server returned an error (400) Bad Request. at Microsoft.Workflow.Common.AsyncResult.End… It looks like below:

Microsoft.Workflow.Client.ActivityValidationException: Workflow XAML failed validation due to
Microsoft.Workflow.Client.ActivityValidationException: Workflow XAML failed validation due to

(Microsoft.Workflow.Client.ActivityValidationException: Workflow XAML failed validation due to the following error):

The above error will come if the list is not available, or the list title and URL are not the same as your source site. In the above case, the list URL was different. In my source site the list URL contains a space but in the destination site, space was not there. That was creating the issue.

To resolve the above issue follow the below step:

  • Correct the List URL/Title exactly same as your source site.
  • Then Deactivate and Delete the existing solution from the Solution gallery (Site Settings page)
  • Then open the SharePoint site using SharePoint designer, go to the Workflow tab and delete the workflow from a designer.
  • Then re-upload the solution, activate the solution and then activate the feature. Then it will work fine. Deleting the workflow from SharePoint designer 2013 is also very important

Read SharePoint 2013 designer workflow tutorials:

I hope this tutorial helps us to learn how to deploy SharePoint designer workflow into production. It should fix the below queries:

  • How to deploy sharepoint designer workflow into production
  • SharePoint 2013 copy workflow to another list
  • How to move list workflow of SharePoint 2013
  • How we can copy SharePoint designer 2013 workflow from one site collection to another site collection in SharePoint online.
>