How to pause a workflow for less than 5 minutes

  • 4 March 2015
  • 3 replies
  • 183 views

Userlevel 7
Badge +10

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


3 replies

Badge +2

Here is my alternative that uses Execute SQL to pause workflow for less than 5 minutes Another SharePoint Blog: Pause a Nintex workflow for less than 5 minutes in SharePoint Server and Office 365

Badge +5

Ivan, I tried the SQL method you suggested and it worked out great. The PowerShell action we use is asynchronous so it doesn't help in this case.

Thanks

Badge +6

You state to avoid pausing for long periods of time.  What is a long duration? >5 minnute, >10minutes  >24 hours 


 

Reply