cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

A lot of NintexWorkflowHistory items

Hi to all!

 

Some days ago I've saw that there are too many SharePoint NintexWorkflowHistory items in SharePoint Manager. Screenshot attached. Is it bad, can it harm to system stability or working speed? Thanx!

nintexHistory.png

Labels: (1)
0 Kudos
Reply
4 Replies
Automation Master
Automation Master

Re: A lot of NintexWorkflowHistory items

Hi Nikolay,

You should really consider purging the history list or some alternative.

Start with these articles:

Demystifying Workflow History (Part 1)

Defensive Workflow Design Part 1 - Workflow History Lists

With these number of items in the history list, what is your list view throttle limit? Do you ever reference the history list directly?

Reply
Not applicable

Re: A lot of NintexWorkflowHistory items

Thanx a lot, Kapil Joshi!

Maybe you can tell why this doesn't work for me (NWadmin.exe)?

I want to delete all records which older than "today -205 days"

cls
set-psdebug -trace 2;

if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null) {
    Add-PSSnapin "Microsoft.SharePoint.PowerShell"
}
try
{
Start-SPAssignment -global;
 
$siteurl = 'http://my.company.com/Sites/Site'
$site = Get-SPSite $siteurl
$historysize = 205
$date = get-date (get-date).adddays(-$historysize) -format 'yyyy-MM-dd HH:mm'


foreach ($web in $site.AllWebs) {
  & "C:\Program Files\Nintex\Nintex Workflow 2010\nwadmin.exe" -o PurgeHistoryListData -siteUrl $web.url -days $historysize -verbose -silent
  & "C:\Program Files\Nintex\Nintex Workflow 2010\nwadmin.exe" -o PurgeHistoryListData -siteUrl $web.url -state All -deletedlists -verbose -silent
  & "C:\Program Files\Nintex\Nintex Workflow 2010\nwadmin.exe" -o PurgeHistoryListData -siteUrl $web.url -state Cancelled -days $historysize -verbose -silent
  & "C:\Program Files\Nintex\Nintex Workflow 2010\nwadmin.exe" -o PurgeHistoryListData -siteUrl $web.url -state Error -days $historysize -verbose -silent
}


#& "C:\Program Files\Nintex\Nintex Workflow 2010\nwadmin.exe" -o PurgeWorkflowData -deletedSites -silent
& "C:\Program Files\Nintex\Nintex Workflow 2010\nwadmin.exe" -o PurgeWorkflowData -siteCollectionUrl $siteurl -state Completed -lastActivityBeforeLocal $date -silent
& "C:\Program Files\Nintex\Nintex Workflow 2010\nwadmin.exe" -o PurgeWorkflowData -siteCollectionUrl $siteurl -deletedlists -silent
& "C:\Program Files\Nintex\Nintex Workflow 2010\nwadmin.exe" -o PurgeWorkflowData -siteCollectionUrl $siteurl -state Cancelled -lastActivityBeforeLocal $date -silent
& "C:\Program Files\Nintex\Nintex Workflow 2010\nwadmin.exe" -o PurgeWorkflowData -siteCollectionUrl $siteurl -state Error -lastActivityBeforeLocal $date -silent
foreach ($web in $site.AllWebs) {
  & "C:\Program Files\Nintex\Nintex Workflow 2010\nwadmin.exe" -o PurgeWorkflowData -url $web.url -state Completed -lastActivityBeforeLocal $date -silent
  & "C:\Program Files\Nintex\Nintex Workflow 2010\nwadmin.exe" -o PurgeWorkflowData -url $web.url -deletedlists -silent
  & "C:\Program Files\Nintex\Nintex Workflow 2010\nwadmin.exe" -o PurgeWorkflowData -url $web.url -state Cancelled -lastActivityBeforeLocal $date -silent
  & "C:\Program Files\Nintex\Nintex Workflow 2010\nwadmin.exe" -o PurgeWorkflowData -url $web.url -state Error -lastActivityBeforeLocal $date -silent
}

$web.Dispose();
$site.Dispose();
Write-Host 'Ok!';
Stop-SPAssignment -global;
           
}
catch
{
  echo $_;
}
set-psdebug -off

----------------------------------------------------

It show me something like:

Parameters to purge workflow data:

Workflow Name: All workflows
State: Completed
Last activity was before: 29.09.2014 20:25 Local
Site: http://my.company.com/Sites/Site

Continue? (yes / no)

I enter yes and... nothing. Silence.

Count of items in site's NintexWorkflowHistory list is not reducing. Count of DB table rows growing as well..

0 Kudos
Reply
Not applicable

Re: A lot of NintexWorkflowHistory items

Gentlemen, I really need some help..

historytab.png

0 Kudos
Reply
Not applicable

Re: A lot of NintexWorkflowHistory items

Thanx a lot to Vadim Tabakman, my WorkflowProgress DBO became some less and now it has about 75 millions rows. But when I checked [SELECT TOP 1000 ROWS] I saw that table still has many old items. I can not understand why they was not deleted.

May be due date\time format? On a screenshot date format contains seconds, and in my script I've used "$date = get-date (get-date).adddays(-248) -format 'yyyy-MM-dd HH:mm'". Have any idea?

WorkflowHistoryDBO.png

0 Kudos
Reply