Skip to main content
Nintex Community Menu Bar

How to quickly identify large workflows in SharePoint

  • October 17, 2014
  • 4 replies
  • 191 views
  • Translate

Forum|alt.badge.img+10

Products: Nintex Workflow 2016, Nintex Workflow 2013, Nintex Workflow 2010

 

A common cause of workflow failure is size. Additionally, large workflows can cause widespread performance issues in your SharePoint farm. This article provides instructions on how to locate large workflows.

 

Run the below (attached as well as a *.txt file for your convenience) PowerShell script (PowerShell ISE works well) from a SharePoint Server:

 

PowerShell Script

Add-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction SilentlyContinue

 

#Workflows that are larger (in Kb) than threshold will be returned.
[int]$threshold = 500

 

function Get-WorkflowFolders {
PARAM
(
[Parameter(ValueFromPipeline=$true)] [Microsoft.SharePoint.SPWeb] $SPWeb
)

BEGIN {
  }

END {
}

PROCESS {
  $SPWeb.GetFolder("Workflows").SubFolders
  $SPList = $null
  [GC]::Collect()
}
}

 

function Get-WorkflowData{

PARAM
(
[Parameter(ValueFromPipeline=$true)] [Microsoft.SharePoint.SPFolder] $SPFolder
)

BEGIN {
  }

END {
}

PROCESS {
        $obj = New-Object -TypeName PSObject -Property @{

        WorkflowSize = [Int]0
        ParentWebUrl = $SPFolder.ParentWeb.Url
        FolderUrl = $SPFolder.Url
        Url = $SPFolder.ParentWeb.Url + "/" + $SPFolder.Url

        }

  $SPFolder.Files | ForEach-Object{$obj.WorkflowSize += [Int]$_.Length}

        $obj

  $SPFolder = $null
        $obj = $null
  [GC]::Collect()
}

}

 

$(Get-SPWebApplication) | Get-SPSite -Limit ALL | Get-SPWeb -Limit ALL | Get-WorkflowFolders | Get-WorkflowData | where {$_.WorkflowSize -gt $($threshold * 1024)} | FT Url, WorkflowSize

 

The size of workflows returned can be adjusted by modifying the $threshold variable (default is 500 or 500kb).

Did this topic help you find an answer to your question?

4 replies

Forum|alt.badge.img+6
  • 40 replies
  • June 15, 2017

Does this apply to Nintex for Sharepoint 2016 also?

Translate

Forum|alt.badge.img
  • 2 replies
  • November 2, 2017

I see a difference in the size of the Nintex workflow  between the .nwf exported from  SP 2013 site settings-> Nintex Workflow gallery  and the output of the powershell from the script given in this article. If the exported .nwf file is 586 kb but the corresponding output of powershell for that workflow entry  was 1.24 gb.. please clarify me on this  size difference

Translate

Forum|alt.badge.img+1
  • 3 replies
  • July 17, 2018

I saw the same issue as Deepti Kumar, above. For example, one exported workflow was 599 KB, but the PowerShell script showed the same workflow as 743kb. Which size is accurate? 

Translate

Forum|alt.badge.img+10

743kb is correct as this is the actual workflow size in SharePoint.

Translate

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings