Tuesday, 12 March 2013

Sharepoint 2010: Increase workflow frequency in Powershell

My current project relies heavily on Nintex Workflow 2010 to process its workflows. The solution is littered with NWF files and I am generally at the mercy of the Sharepoint Timer Service about when to start the process.

I run the following script to increase the (default) frequency that the workflows are polled for work. It should be noted that although this is great for a development environment, but will probably cause more harm than good in a larger shared environment.
There may be some serious resource contention if 1000s of workflows are running every minute.

Anyway, on to the the script:

Write-Host "Setting workflow postpone threshold to 30"
Set-SpFarmConfig -WorkflowPostponeThreshold 30
Write-Host "Setting the polling frequency to evert minute"
get-sptimerjob | ?{$_.name -like "job-workflow"} | set-sptimerjob -schedule "every 1 minutes between 0 and 59"
Write-Host "Configuration Complete"

No comments:

Post a comment