Deploy SPD Workflow from Development to Production Environment

Deploy SPD Workflow from Development to Production Environment

As best a practice, many teams set up solutions in a development environment. The solution is created, tested and finalize in a Development environment. Once the solution is finalized, it is deployed to the production environment. This post outlines the steps to deploy a workflow and common errors to avoid.

Note: 2010 List workflows cannot be deployed as a solution therefore avoid 2010 List workflows if you are required to use a development environment.

Steps to Deploy Workflow

  1. Open SharePoint Designer in the development environment, and save each workflow as a template
  2. The workflows will be saved to the Site Assets library. Download the workflow(s)
  3. Open the production top level site, navigate to site settings then Under Web Designer Galleries select Solutions
  4. Upload and Activate each Solution
  5. Navigate to the sub site where the list solution is (if its at the top level stay in the top level site), go to Site Settings then under Site Actions select Manage Site Features.
  6. The Workflow should display towards the button of the feature lists. Select the Activate button for the workflow.

Checklist to review before deploying a workflow.

  1. Ensure all lists, libraries and columns referenced in the workflow exists in both locations.
  2. Ensure all production lists/libraries are created with the same URL and List/Library description as the development area.
  3. Ensure all list/library columns have the same internal name and display name in development and production environments.
    1. Internal Name is the name the column was given when it was created. This name doesn’t change even if you rename the column. When you rename the column, the internal name stays as the original name. The name displaying in the list/library is now the display name.
    2. You can check the internal name by going to list/library settings then in the column section, select your column.
    3. At the end of the URL, you will see Field={whatever your column name is}. This is the column Internal Name.
      Note:
      In the internal name, any spaces get replaced with _x0020_
      If the column internal name already exists it will add a 0 after the internal name
    4. If the column internal name is different from production to development then recreate the column with the internal name and then rename it, if needed, to match the display name.
    5. If the display name is different, just rename the column.
  4. Make sure the Production site has a workflow history list.. To check if your site has a workflow history list, paste the URL below into your site. If you can an error page cannot be found, a new list will need to be created.
    URL: {Your Site}/Lists/Workflow%20History/AllItems.aspx

    1. Navigate to any library on the site
    2. Go to library settings then workflow settings
    3. Select Add a workflow
    4. Select any of the template workflows that come with all SharePoint sites.
    5. Give the Workflow a unique name
    6. If there is no Workflow History List it will say new next to the name. Then select Next.
    7. Select Save in the next screen.
    8. This will automatically create the workflow history list.
  5. Make sure the App permissions are enabled if used in the workflow.

If you already deployed the workflow and run into one of these errors. Fix the error, delete the solution from the site and then re-deploy.