Dan Sanders
  • Home
  • About
  • Contact
  • – PowerShell
  • – SharePoint
  • – Workflow
Copyright © 2016 Dan Sanders. All Rights Reserved.
Dan Sanders
  • Home
  • About
  • Contact
  • – PowerShell
  • – SharePoint
  • – Workflow

Publish SharePoint 2013 Workflow Globally

byDan Sanders inPowershell, SharePoint, Workflow posted28 February, 2016
0
0

Publish GloballySharePoint Designer 2013 has a button to publish SharePoint 2010 reusable workflows globally so that they can be used in any library.

This button is greyed out for the SharePoint 2013 workflow platform and so appears to not be supported.
We can, however, get a similar result by saving the SharePoint 2013 reusable workflow as a template and deploying it as a solution to a Site or Farm.

The SharePoint 2013 workflow platform has many great features, including the ‘Call HTTP Web Service’ which you can use to call the SharePoint 2013 REST service to access and update SharePoint data across any site.

My workflow utilises many REST calls and so the 2010 platform was not sufficient.

Deploy reusable workflow globally

1.) Create a reusable workflow with platform type ‘SharePoint 2013 Workflow’.

2.) Once you happy to deploy your workflow; on the workflow settings page, click ‘Save as Template’ button on the ribbon.

3.) Download the template from the ‘Site Assets’ library.

4.) To deploy to a Site Collection:
Site Settings > Solutions > Upload Solution > Activate.

5.) To deploy to a Farm
Open SharePoint 2013 Management Shell

Add-SPSolution C:tempworkflowfilename.wsp

Central Administration > System Settings > Manage farm solutions

From here you should now be able to see your workflow listed.
Click on its name and click deploy.

Once deployed the workflow will be available at each site as a feature that needs enabling in order to add it to a library.

Enable the workflow on each site with PowerShell

Get the feature identity

To get the identity of your new workflow feature, deploy it manually on one site and then look it up with PowerShell:
Site Settings > Manage site features > find your workflow feature and enable

Get-SPFeature -web http://site/web | Format-Table DisplayName

Where http://site/web is the URL of your web that you enabled the feature at.
Take note of the correct name of your feature.

Enable feature across sites

In the below code I enable two features, the Publishing Feature, and my Inwards Mail workflow feature.
I enabled the Publishing feature because I will be deploying the workflow to each library through PowerShell and so will need the Tasks and History lists created at each site. Enabling the Publishing feature creates these lists for you.
The below code only deploys the feature on every sub-site of the 3rd web layer down:
$web = $Web = Get-SPWeb http://Site/Web
$Web.webs | ForEach-Object {
  $_.webs | ForEach-Object {
    try{
      $_.url
      Enable-SPFeature -URL $_.url -Identity "Inwards Mail ProcessListInstances"
      write-host "InwardsMail feature added"
      Enable-SPFeature -URL $_.url -Identity "PublishingWeb"
      write-host "publishing feature added"
    }
    catch{
      write-host "Failed to add feature to" $_.url
    }
  }
}

To enable at every site in the Site Collection, paste the above try catch statement into the Web loop on this post.

Next; Associate the workflow to every library/list using PowerShell

PowerShellSharePointSharePoint 2013SP2013 Workflow
Share this :

Related Posts

0
17 September, 2013
Remove Drop Off Library and fix up the QuickLaunch in SharePoint 2010

SharePoint Designer 2013 has a button to publish SharePoint 2010 reusable workflows globally so...

67 Comments
0
Adding a column to a Content Type (CT) at a library level with PowerShell.
10 February, 2016
Adding a column to a Content Type (CT) at a library level with PowerShell.

SharePoint Designer 2013 has a button to publish SharePoint 2010 reusable workflows globally so...

67 Comments
0
Remote PowerShell with SharePoint 2010 Kerberos
31 July, 2013
Remote PowerShell with SharePoint 2010 Kerberos

SharePoint Designer 2013 has a button to publish SharePoint 2010 reusable workflows globally so...

224 Comments
0
25 June, 2013
Deploying SharePoint 2010 Solutions with Powershell

SharePoint Designer 2013 has a button to publish SharePoint 2010 reusable workflows globally so...

20 Comments
0
28 April, 2016
Disable Loopback check – UPA Picture Sync Error

SharePoint Designer 2013 has a button to publish SharePoint 2010 reusable workflows globally so...

73 Comments
0
Fix SharePoint 2013 UPS Stuck on Starting
4 July, 2018
Fix SharePoint 2013 UPS Stuck on Starting

SharePoint Designer 2013 has a button to publish SharePoint 2010 reusable workflows globally so...

54 Comments
0
24 June, 2013
Enable Fly-Out for Quick Launch

SharePoint Designer 2013 has a button to publish SharePoint 2010 reusable workflows globally so...

96 Comments
0
Creating a view for each Document Library in a Site Collection
3 February, 2016
Creating a view for each Document Library in a Site Collection

SharePoint Designer 2013 has a button to publish SharePoint 2010 reusable workflows globally so...

135 Comments
7
Enabling multiple Document Set views
20 September, 2017
Enabling multiple Document Set views

SharePoint Designer 2013 has a button to publish SharePoint 2010 reusable workflows globally so...

2 Comments
0
Quick Edit button grayed out
3 February, 2016
Quick Edit button grayed out

SharePoint Designer 2013 has a button to publish SharePoint 2010 reusable workflows globally so...

No comment

Leave a Comment! Cancel reply

You must be logged in to post a comment.

Recent Posts

  • SharePoint Add-in 401 Unauthorized
  • Content Database and Site Collection Report
  • SharePoint helpful hidden URLs

Tags

Config (1) Content Types (2) Design (3) Document Libraries (7) Document Sets (1) How-To (1) Lists (4) Office365 (1) PnP (1) PowerShell (12) Quick Edit (2) REST (1) SharePoint (11) SharePoint 2010 (11) SharePoint 2013 (14) SharePoint Foundation (2) SharePoint Online (1) SP2010 Workflow (2) SP2013 Workflow (3) Systems (2) User Profile Service (1) Views (5) Windows Server (1) Workflow (2)

Archives

  • November 2020
  • December 2018
  • September 2018
  • July 2018
  • September 2017
  • August 2016
  • April 2016
  • March 2016
  • February 2016
  • January 2016
  • September 2013
  • July 2013
  • June 2013