cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

For Each with query XML taking aaaaages to run

Hey everyone,

I've got a workflow For Each action that contains 6 query xml actions, and a 'build string' at the end to compile those XML queries into a string. When it's looping 2-4 times it's taking well over 30 minutes to run when it loops only 4 times (sometimes nearly an hour).

This seems excessively long to me, but I'm mainly used to working in on-prem Nintex WF. Is Safe Looping turned on in 365 workflows by default? Is that likely what is causing this horrendous lag?

Does anyone have any ideas on potential avenues for speeding this up?

Thanks!

Scott

Labels: (1)
Reply
13 Replies
Workflow Hero

Re: For Each with query XML taking aaaaages to run

Hey Scott,

This kind of time is not really expected.

Is there anything else in the loop other than query XML action?

Can you PM me a workflow history URL for an example that took a lot of time, I'll take a look into it for you.

Callum

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: For Each with query XML taking aaaaages to run

I have always experienced the same ridiculous lag on these actions.  Been that way for at least 1.5 years, and hasn't really shown signs of improvement.  I've done a few posts and help requests on it, but it hasn't really ever gone anywhere.

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: For Each with query XML taking aaaaages to run

Thanks for the input Brent. In your experience is it the For Each that causes the lag? Or the query XML? Or the combo of both?

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: For Each with query XML taking aaaaages to run

Been a while since I looked at the couple of workflows doing these actions, but I feel like it was the combination.  A single query XML goes pretty quick, but the subsequent ones inside the foreach are what take a while.  By themselves I havent really noticed an issue, but together it definitely goes slower than I would figure it should.

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: For Each with query XML taking aaaaages to run

I am also observing this sort of issues. I even decided to remove the Query XML action and replace it with regular expression. I don't know why this is lagging so much.

I asked the same question in January () when a single run of loop required minutes to complete, and when having tens of runs workflow was executing hours.

It then suddenly changed, and so a single loop needed around minute, what still is a lot regarding the fact, that XML is small and a rule is easy, but was acceptable. But I see, as the problem still occurs, that my transition to regular expression was a good move.

Regards, 

Tomasz 

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: For Each with query XML taking aaaaages to run

Interesting, thanks guys! That lag period was killing my process, so I’ll take your advice Tomasz and replace my Query XML with some Regex Extracts. Hopefully that speeds this up a bit, because the workflow I just ran with 12 loops just took over an hour!

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: For Each with query XML taking aaaaages to run

Scott, can I ask which Nintex O365 region you are using currently? 

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: For Each with query XML taking aaaaages to run

Hey Callum,

The client is based in west coast US, so it would be North America I assume!

Cheers

Scott

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: For Each with query XML taking aaaaages to run

Hey everyone,

Just a quick update on this one : I changed it the actions from Query XML to Regular Expression and it works much quicker now. 10 minutes whereas before it would take over 30 minutes.

So obviously Query XML + For Each = Lagtown...

0 Kudos
Accept as Solution Reply