aaron.labiosa@nintex.com

How to pause a workflow for less than 5 minutes

Blog Post created by aaron.labiosa@nintex.com Champion on Mar 4, 2015

We often see requests of how to pause a workflow for less than 5 minutes. Until now this has not been possible as the pause action relies on the SharePoint Workflow Timer Job to wake the workflow instance back up (occurs every 5 minutes) after the indicated amount of time.

 

Utilizing PowerShell you can effectively pause a workflow all the way down to 1ms. While a PowerShell script is running it will hold up the progress of the workflow until it completes. To set this up you simply need to set the PowerShell action to execute this command:

 

PowerShell Script
  1. [System.Threading.Thread]::Sleep(20000)

 

Note: 20000 would be a 20 second pause.

 

Here is a screenshot of the action blocking for 20 seconds (Nintex rounds up to the minute for display purposes):

 

2015-03-04 14_35_08-Workflow Progress_ Thread Sleep test - Internet Explorer.png

Note: Avoid pausing the workflow for long periods of time as it may result in the workflow batch timing out.

 

You can obtain the PowerShell action here: NTX PowerShell Action - Initial Beta Release

Outcomes