Skip to main content
Nintex Community Menu Bar

Bug - Workflow in elevated permissions runs twice

  • December 12, 2019
  • 4 replies
  • 14 views

allan
Nintex Partner
Forum|alt.badge.img+9

Hi everyone,

 

Something really strange is happening on my production farm.
I have a workflow on a list with an action set to run with elevated privileges, in this action set I have a state machine.
Every action inside this action set is run twice. We can see this in the logs. Each action is not run twice in a row, but instead, the workflow run correctly and create tasks for a flexi task, only then the whole process repeats. I have then twice the tasks.

 

Please also note that answering task does not do anything. All the tasks created are set as "No response longer required" as if I had choosen an outcome for one of the tasks. Even with approving task, no task changes status and stays in Pending.


I suspect that this "run elevated" action set is the culprit but I am developping with a site collection admin user, and had no problem for months with this specific workflow, only now when developping new features.

 

Any help or advice is welcome !
Thanks

4 replies

Simon Muntz
Nintex Partner
Forum|alt.badge.img+23
  • Nintex Partner
  • December 12, 2019
Hi,

In general when a state machine worklfow runs branches twice it is because the state machine is not configured correctly.
Make sure that every branch of the state machine has a change state action or an end state machine action.

If you would like me to look over the workflow either post some screen shots or provide an export.

allan
Nintex Partner
Forum|alt.badge.img+9
  • Author
  • Nintex Partner
  • December 13, 2019

Hi Simon,

 

Yes, I have a change state in every branch, the workflow did run fine for months. The thing is that the workflow is looping even when it is waiting for a task to be completed.

I have also noticed that the workflow does not run twice if I do not cancel it (for my item, it's been 4 times since yesterday 6pm)

The issue is not a problem in the design of the workflow, but a problem with Workflow timer service I suppose (Nintex on-prem workflows are SharePoint 2010 workflows)

 

Some screenshots :

5931i34F1AB1DB92E4DBA.png5932iF347279D40E6AFEA.png5934iA92BD2A57312BA31.pngThanks


Simon Muntz
Nintex Partner
Forum|alt.badge.img+23
  • Nintex Partner
  • December 15, 2019
It could be just the way the screen shot came out but to me it looks like this state machine is not designed correctly.
It looks like there is commit pending changes and UDA's after the change state/end state machine workflow actions which is not correct.
If you provide an export of the worklfow I can verify the design.

allan
Nintex Partner
Forum|alt.badge.img+9
  • Author
  • Nintex Partner
  • December 17, 2019

Hi Simon,

Thanks for the input, but it's not the screenshot that was incorrect (we can see that in the version history), neither the UDA (which has always worked).

I have found the issue, and it was a crazy one :

It was a "Set variable" inside the second action set "Delegation".
I used a query list, that returns the ID of the item, but I did not had the Row Limit set to 1. When I used the "set variable" action (set myVar with field1 from list1 when ID is equals myItemIDvar). Since the "query list" returns a collection with only one item, the "set variable" crashed, but without rasing an exception.
It took me hours of debug, and I still do not know why the whole elevated action set is re-run (I suppose a change of context), but this is definitely what is happenning.