I have a workflow in which I must both update an item and set the item permissions. Intermittently the workflow throws an ambiguous error (e.g. "An error has occurred in [name of the workflow]"). E.g. an error occurred somewhere in this series of actions...
In this instance, the "Update Action" item was successful, but the item permissions were not set, and the workflow did not proceed beyond this point.
I've tried reversing the order of these actions (set permissions first, then update item) and have tried with and without the "Commit pending changes" action.
I'm speculating that either I'm stepping on my own toes (one action makes the list item unavailable for the other action) or that users are trying to update the item at the same time (making the list item unavailable), but I don't know how to diagnose this further.
Next step is to create a new text field, write something unique to it in the "Update item" action, then use it in conjunction with a "Wait for item update" action and put that in front of the "Set item permissions" action.
Is there a best practice for this?
I've been busy. Since the last post I've been trying increasingly desperate things to try and mitigate this problem, including:
Nothing I've tried so far makes a bit of difference. Errors continue to occur intermittently and seemingly at random and (I haven't started gathering metrics on frequency and rate) seemingly at the same rate. Every day I seem to be clearing 10-20 errors (never 2 or 3, and never 50).
My latest theory is "maybe the workflow is just too complicated" so I'm doing what I can to simplify. It's basically a series of 8 "Run if" actions, one of which is intended to run. I'm replacing the "Run if" statements with a single switch statement (does that make any difference under the hood, or just make me feel more organized when I view it?) Next I plan to break the "run if" actions into separate workflows (so my switch statement will select the right workflow to run). I have no reason to believe this will help (better to run two simpler workflows than one complex workflow) but I'm sort of at the "try anything, hope, pray" stage of troubleshooting.
Have you tried just a workflow with just the update action to see how that fairs?
also as above but with static values (rather than passing in any variables)
I have tried just the update action alone (e.g. I've removed the permission change but within the context of the larger workflow), but not sure exactly what you mean about the static values. Some of those update actions update fields with both static values (e.g. I type in the value); some use workflow variables, and some use the values of other columns.
so you say the workflow was failing even in the case you removed set permission action?
then it doesn't seem an interaction between the two cause problems.
can you provide any details on update item action? does it update an item which the workflow runs on? or is it an item from a different list?
what type of columns do you update? typically lookups and people fields cause such intermittent problems.
can you try to add commit changes action before update item action? - to proof check whether changes previous collected changes doesn't in fact cause problems, but are applied together with your update action.
I'm updating the item on which the workflow is running.
Type of columns I'm updating. In one instance I'm updating:
I have added a Commit Changes action before the Update Item actions and will see how that goes.
Thanks for your suggestion.
I would guess people field causes problems.
it internally behaves like lookup, and as mentioned above these can often cause problem.
could you try without that single field?
Thanks so much for all of your suggestions. Errors occur even when this step is removed entirely; however, I did try removing the user field update only for a week, and there is no noticeable change. Errors continue happening at about the same rate.