I have a SP2013 installation and Nintex Workflows on top of it. In my workflows, I have to poll for a result from an external web service using a for each loop. The workflow is part of a demo and so things have to move quickly.
Unfortunately, each iteration takes more than 5 minutes. I tried adding a "wait for" action and defined the minimum of 1 minute (which should be enough for my demo) but instead of 1 minute it takes around 6.
Any help is much appreciated.
I would suggest doing some testing - in this case I would disable the Web Service call to see if everything moved along as expected with out it. The For Each action isn't bound by Safe Looping like the Loop action so it being the reason for the pause would surprise me. I think that maybe your Web Service is taking long to respond or even timing out - if you could post some screen shots to give us a better look at what you have going on inside the For Each that would help as well.
Indeed, disabling safe looping and republishing the workflow solved the issue.
Since this is not a production environment and used only for demos, there is no issue with safety here.
The one odd thing about all of this is that the trick did not apply for the "Waif for" action. When i specify 1 minute in for this action, it still takes around 5 minutes to execute.
When you use the "Wait for" action, the current process no longer runs the workflow. It's relayed to the Timer job and the pause depends on its next execution, which is by default every 5 mn.
Manfred Lauer gave you a good reference on how to change it.