Workflow fails "Error occurred" randomly. I have a client where workflow fails for some items sometimes. Sometimes it goes through and completes as it should. The last step it performs when it fails is always the same: "Commit Pending Changes". The loop before this action creates some items within sharepoint lists, logs into the history. What can be a reason for this? I suppose it might be timeout at some point. ULS doesn't give any particular error message. If workflow fails, i terminate it, then i run the workflow again manually and it always completes. It only fails when it is automatically triggered and not always. Can anyone help?
What you might be seeing is a timing issue where the workflow goes into a hold/pending status until everything or completes. I've seen this before with out of the box or SharePoint designer workflows so its not necessarily specific to just Nintex. As for a resolution, in those cases I have re-evaluated my logic to simplify some aspects of it or split the workflow into two or more workflows to allow for process completion to occur quicker.
As Eric Harris mentioned, this is due to the performance issue in the workflow. You need to revisit the workflow logic and try to simplify or split the workflow.
Thank You Eric and Nidish!
I will need to do as you mentioned.
1. Do you think placing "Pause the workflow for specified time period" action somewhere in the loop will help anyhow here?
Also, another fact is, for some time in the past, issue occurred like few times (only for few items), then, since one of the web front end servers role was taken apart (one web front end has been detached) the issue occurs almost for each item in the list. So that also confirms timeout root cause given by you as there is one server less to serve and run the workflow services which means bigger load is going just through one server and it time outs more often.
2. Moreover, in the ULS I found one error: "Failed to get SPGroupName from GroupID. Error Message: Group cannot be found". But I assume, if the problem would be with the SharePoint group, none of the workflows would complete. Correct me if i'm wrong?
Thanks again for such prompts replies. Can you please also advice on points 1 and 2?
Guys and one more thing:
Why it always completes when i run the workflow again but manually on the item where it previously failed? Can't understand that.
One your points:
1. Pause for action, yes. i think you can add this action at the very beginning of the workflow and try whether error occurs. basically when pause is added workflow starts executing from back end job. So this will help reducing the error. Regarding the server detaching, obviously there will be affect on the performance as you are now using less resource.
2. Well regarding group id. If group id is missing, all the workflows trying to use that group should have an issue.
i would suggest using Pause for 5 mins in the very beginning of the workflow and check the behavior of the workflow for few days. If nothing helps, you need to optimize the workflow
We too faced this issue. the workflow used to error out when it started on item add event. However, after terminating the error instance and restarting the workflow, it used to run without any issues initially. However, as they days passed, even manual start used to error out.
After few analysis, we found that workflow was bigger in size and lots of SharePoint updation across the list. Hence as a solution we added a pause for 5 mins in the beginning of the workflow, which fixed the issue of workflow getting errored out.
Thank You Nidish!! I'm really amazed of your prompt replies!! Thanks a lot!! I will try that out and let you know the outcome!!
Have a good day!!