How long does "Delay for..." really wait?

First looking at the action "Pause for..." I was thinking think that I could configure the delay period precisely to the minute.



However, when I used this activity I discovered that the activity did not behave as I as expected. This was especially true when I entered an interval shorter than five minutes. I always waited longer than configured.

Looking deeper, I found out that the cause for this is the SPTimerJob job-workflow which controls the triggers for "
Pause for...". This timer job runs with the standard configuration every five minutes. If you set "Pause for..." to a shorter interval, the trigger send by the timer job will be sent every five minutes anyway. The same applies when you set the action to pause the workflow for any period of time that lies between the configured schedule for job-workflow.

Of course, an option to solve this issue is to reconfigure the timer job to run in shorter intervals. But ask yourself if this is really necessary. In my experience this is mostly annoying during demos or the design phase. If your workflow design relies on a shorter interval you should consider a redesign. The workflow engine has not been designed for timing actions to the minute.

Nintex advises, that the full impact of shortening the interval below the standard configuration of minutes cannot be estimated. Therefore the following change should only be done for demo and development systems.

  • SharePoint 2007
    stsadm -o setproperty -propertyname "job-workflow" -propertyvalue "every 1 minutes between 0 and 59" -url http://<webapplication>
  • SharePoint 2010
    Set-SPTimerJob -Identity 'job-workflow' -Schedule 'every 1 minutes between 0 and 59' 
If you have more issues with the responsiveness of the timer job, Comeron McConnel has collected some tips what you can do in his post Increasing the responsiveness of the workflow timer job on Nintex Connect.

This behavior also applies to all actions where you can enter a specific time or a time interval. Examples:

  • Flexi Task (escalation)
  • Pause for / Delay For
  • Pause until / Delay until
  • Change State
  • Loop
  • ...

Comments

  1. This comment has been removed by the author.

    ReplyDelete
  2. Great post.

    FYI - the delay shouldn't affect the For Each action. There are no hidden delays in that action.

    ReplyDelete
  3. FYI - the delay shouldn't affect the For Each action. There are no hidden delays in that action.

    ReplyDelete

Post a Comment

Popular posts from this blog

How to Handle Environment Variables with Nintex Workflow

Run Now in Nintex Workflow 2010