Per this Marian Hatala post (thx Marian Hatala) I put in a Pause at the top of my WF and I also put in a Commit and Pause (1 min) after every 50 transactions (Create New Item) within a For Each. For some reason 50 records get written out and the Pause says it starts (Pausing for 1 minute) and then after 5 minutes there is an error without the Pause ever completing.
Note the Pause For works fine at the top of the Workflow. Pause completes within 5 minutes.
Why does the Pause For not work within the Loop after 50 items.
Lastly note - I change the iterations to 100 prior to the pause and same behavior - the pause started, but failed. 100 items did get written out to the list though..
I don't think so because if I take off the commit and pause and restrict the query filter to ID 1-100 it runs fine with no issue.However its not realistic for me every night to manually update the workflow to run ID 1-100, then change the WF to run ID 101-200, change the WF to run ID 201-300, change the WF to run ID 301-400, and change the WF to run ID 401-500
My objective is to have every day 500 items created. The query filters for today checklist items which should always be a total of 500 and the For Each should create a new one for the next day. Thus the For Each loops thru each of the 500 records and creates a new record (essentially a copy of the record from today which will then become tomorrows checklist item within the List.
If I try to run all 500 at once then I receive an error, but it does create all 500 items but twice ! Thus your suggestion for the Commit and Pause.
Lastly note the only process in my WF that would be sent to batch is "Create New Item".
Ah, ok. It's in Nintex WF 2016 that I'm experiencing strange behavior of the Pause for action (it seems to think it's part of a loop and jumps back to an earlier action...). In NW 2013 it worked just fine in those instances where I used it.
I can try - what should I set it the expected run-time to and what does that do ...
Note when I remove the Pause For and Commit and then restrict the Query filter 99 items only it runs in 2 minutes !
If I put the Query Filter back to bring in 500, but only triggering the Pause For at every 50 iteration then the WF writes out 50 items and then the Pause For errors at 6 minutes. The Pause For is set to 1 minute and I assumed it waited for the timer for another 5 minutes and then for some reason failed...
If I put the Query Filter back to bring in 500, but only triggering the Pause For at every 50 iteration then the WF writes out 25 items and then the Pause For errors at 6 minutes. The Pause For is set to 1 minute and I assumed it waited for the timer for another 5 minutes and then for some reason failed...
Start with a 1 hour expected runtime, and if necessary increment it with 15 minutes up to 2 hours. I don't think the copying process requires that much more time.
Keep in mind that if indeed the workflow takes too much time to complete you always (at least that's my experience) get an error screen, but it keeps running in the background. However it the entire workflow takes too much time to complete indeed will give another error and may go into Restarting mode.
If that does not work, you could consider creating a list Copy item workflow, which then is started for eacht item from the site workflow using a web service call (StartNintexWorkflowOnListItem). With a little luck you won't need a Pause for in that site workflow....
how do you calculate and check 50 iterations? hopefully it's based on dedicated counter or loop index and not on item ID.
what's the exact error you get on pause within the loop?
is the error the same for set of 50 item as for whole set of 500 items?
do you execute any (high number of) actions on list item before you enter loop? (eg. create items, update items, update multiple items...)
does it (always) fail after first set of 50 iterations? or multiple sets are processed until it errors out?
what else is being executed within the loop apart from creating items?
what does happen if you commit and pause after each item?
I know it will be very slow, but I'm interested in whether it fails after very first item or how many items it handles.
are there any dependencies (lookup links) among items (eg. if item 25 links to item 75...)
do you have any other workflows on the list that might get triggers once you create items?
could you post how does your workflow and configurations look like?