cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Workflow runs as desired but sends error message after all the actions

Hi, I have designed a workflow which runs query on a list and collect the IDs of all the items fulfilling the filter conditions in a Collection variable. Then I run "For Each Loop" on this collection and add some specific permissions to each item. I have set up this workflow such that it runs whenever the item is modified. Although, when it is runs, it performs all the actions as desired and all the permissions are set as I want but in the end instead of terminating, it sends the error message:

"An error has occurred in SetPermissionWorkflow".

Is there any reason why this error is occurring?

Thanks

Ratnesh

0 Kudos
Reply
13 Replies
Not applicable

Re: Workflow runs as desired but sends error message after all the actions

Hi everyone,

I found a post which suggest to put a pause after and before every cycle of the loop. The cause of the error was described as: "Workflow is moving quicker than your variable getting populated". The link is- Postings By Some Cloud/SharePoint/Programmer Guy: Solving "An Error Occurred" in SharePoint Workflow...

But, the pause will cause a long delay in the run of the workflow as there are more than 100 cycles and if I put even 1 min pause for each cycle it would mean that pause will take more than 100 mins. Is there a faster way to solve this?

Please help.

Accept as Solution Reply
Workflow Hero

Re: Workflow runs as desired but sends error message after all the actions

does that mean that pause resolved the problem?

if so, you need not to pause with every single iteration, it might be enough to pause once after X iterations. but yo will have to determine a tune the X specifically for your environment.

note as well that 'pause for 1min' in fact need not mean 1min. the pause will be at least for as many minutes as you have configured timer job frequency in your farm, which is typically 5mins.

Accept as Solution Reply
Not applicable

Re: Workflow runs as desired but sends error message after all the actions

Hi Marian, the pause action also didn't solved the issue. The workflow is still generating error message after all the actions are performed as required.

Accept as Solution Reply
Workflow Hero

Re: Workflow runs as desired but sends error message after all the actions

can you post a screen shot of the the actions in the workflow ?

may be this might help --> Designing your Workflow - Commit Pending Changes Action NW2010 & NW2013

see whether you are performing any of the actions in your WF.

Accept as Solution Reply
Not applicable

Re: Workflow runs as desired but sends error message after all the actions

Hi Amol Vaidya​, I am using the Commit Pending Changes action in my workflow. I believe this means there anything else which might be causing this issue?

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: Workflow runs as desired but sends error message after all the actions

pls take a look at the link i shared before.

it might be that your set security actions are happening in one batch and then nintex is trying for some activity on the item.

also can you try running the workflow as admin. To do this dump the whole workflow in an Action set and set the Action set as "Run as Workflow owner". Then publish the workflow as admin and then execute. See whether this solves the error

Accept as Solution Reply
Not applicable

Re: Workflow runs as desired but sends error message after all the actions

Hi Amol, thanks a lot for the prompt reply but I had already referred the article you have mentioned even before posting the question. I have also tried all the tricks you have mentioned like running the action set as owner and all but, nothing seems too work. I am truly confused.!!

Accept as Solution Reply
Workflow Hero

Re: Workflow runs as desired but sends error message after all the actions

thats weird...can you share the workflow ?

Accept as Solution Reply
Not applicable

Re: Workflow runs as desired but sends error message after all the actions

Sorry I can't. Its confidential information. But the basic structure is:

1. Query List action for another list to get all the IDs for items matching with the filters and store IDs in a collection variable.

2. For each loop to iterate each ID.

3. Query List actions to fetch the names from other lists for the permissions assignment.

4. Set permission action to assign certain permissions to each of these IDs/Items.

5. Commit pending changes action after the set permission action.

Accept as Solution Reply