You are viewing limited content. For full access, please sign in.

Question

Question

workflow activity messages

asked on August 2, 2023

A workflow that I created is running and doing its job correctly, however it is taking longer than expected to run and is taking even longer each instance. Each instance has the same amount of input.

 

I am trying to analyze the instances to view the wf activity metrics. (example pic from test instance with tiny input size)

But, since the instance is running for so long, the amount of activity messages seems to be too big to load.

 

I removed the track tokens activity to try to reduce the amount of overhead.

Is there a way for me to analyze my instance to see what is eating up the resources/load?
 

Overview of my workflow:

 

Goal of workflow is to update security trustee for all found entries and their respective shortcuts, if any.

 

I understand nested loops tend to cause excessive computing so I wouldnt be surprised if they are the cause of this excessice run time. My big O() is rusty.

 

Advice to improve workflow performance would be much appreciated.

 

Also please let me know if clarification on the workflow is needed.

0 0

Replies

replied on August 2, 2023

That amount of instance data is definitely going to cause a problem.

As a general rule, I always avoid running any repeats or loops for more than 250-500 iterations because not only does it become unmanageable to load it also slows down execution of the workflow activities once it gets to be too much.

The exact amount varies because it depends on what all your workflow is doing and tracking.

What you should do is break this up into multiple workflows that can be run with batches.

For example,

workflow 1 invokes workflow 2

workflow 2 runs for 250 iterations then stops

workflow 1 invokes a new instance of workflow 2

etc.

The idea being that you run an instance for a while, but limit it and start a fresh instance every so often to avoid accumulating that much data in a single instance.

Some things I'd look at:

  • Instead of nesting loops inside a for each entry, break that inner functionality into a separate workflow and pass the entry in as the starting entry so each one gets a separate instance.
  • Set a limit on the number of results returned by the Search Repository activity, then create a parent workflow that invokes this one multiple times until everything is done (you can pass back an output parameter to tell the parent instance when there's nothing left and to stop the looping).
4 0
replied on August 3, 2023 Show version history

Thank you Jason, I will make a separate version of my workflow with your suggestions and compare performance!

 

Also just to make sure I understood, in your example, only one instance of WF1 calls as many instances of WF2 needed, correct?

0 0
replied on August 3, 2023 Show version history

In the example I wrote, yes it was 1 instance of Workflow 1 calling multiple instances of Workflow 2, however, based on your design it might make more sense to have 3 or more levels.

  1. Main parent (single instance)
  2. Loop on limited set of Search Repository results
  3. Act on each result (inside for each entry)

It really just depends how many iterations you have for some of the additional loops like the For Each Security Group stuff.

EDIT: Make sure you set the "invoke workflow" activity to wait for the invoked workflow to complete so you have access to output variables and don't accidentally create a bunch of parallel instances.

2 0
You are not allowed to follow up in this post.

Sign in to reply to this post.