I have a site workflow which I usually trigger manually, the workflow executes for couple of minutes (usually 30 minutes-the workflow logic is bit large and it has to build and send out reports to around thirty people), after executing for 30 minutes the workflow says failed on start(retrying) though it builds and sends out reports to users by that time and again starts executing the same workflow steps and does send out duplicate emails to all the users and I manually have to end the workflow. Any help is appreciated.
Solved! Go to Solution.
Thanks for your response. I did that, it didnt solve the purpose. One thing i would say mine is a fairly complex workflow and generally takes around 25-30 minutes to complete, so would that be any reason for this issue? I have few "Query User profile" actions in the workflow. Would you suggest in removing these actions?
What do you mean with fairly complex workflow? How many actions does it include?
I see this error message regularily on complex workflows that need too long to compile / start and in the end get cancelled at start.
If the workflow contains more than lets say 50 actions you should consider splitting it up into separate workflows. Usually this solves the error for me.
Hmm yes, my workflow has more than 50 actions and does splitting works back and forth between parent and child workflow? I guess the splitting is only one way(going from parent to child) , please correct me if i am wrong? My workflow is something like this --i have a one for each loop and most of my workflow logic(actions) are under this loop, so how can i split it?
you can take some part of the overall logic executed within loop and move it to another workflow. then instead of cut off part you would just call that workflow.
the best approach is to separate such a part that can be repeatedly used, or provides some encapsulated logic (like collect/determine report receivers, build report content, calculate some specific report figures), etc.
if possible, could you try following test?
try to republish the workflow at times of heavier load on your sharepoint. if it is able to publish (and so compile) without problems, it shouldn't be a problem to compile it at runtime.
it could give you valuable hints what might cause problems.
query user profile on its own shouldn't be a problem. but performance of a single query could be.
if the query take too long, I can imagine it might be missed some timeout which may cause unpredictable workflow behavior.
have you examined workflow log how much time does it take for single actions (not only query profile)? is those 30mins reasonable time for amount of work what should be performed? what is/are slowest actions?
similar consideration might be applied on send mail action.
if you build "big" report, possibly add some big attachement(s) it as well might take some time while the message is handed over and accepted by your mail server.
further questions are, does it error out with each start? or is it just occasional?
does it somehow depend on how big report you need to create? or how many receivers the report have? or how many loops you need to iterate through to send the report?
in either case, I highly recommend to put pause action at the begging of the workflow, even if it doesn't resolved the problem (yet).
I made the following changes.
1) Optimized the for each loops i had, there were couple of for each loops in my logic which were doing many iterations, so i've optimized those loops as much as i could.
2) I've split the workflow. (Also i found out that only one variable can be exported at a time)
Looks like these changes solved my issue.
Thanks everyone for responding, will be back if i face the issue again