I have two lists. In the first list, the user inputs the number of items they want to create in the second list. The workflow creates the items successfully, but it's running extremely slow.
Example: User wants to create 3 items in the second list. Workflow runs and creates 3 items taking information from the first list. It takes up to 15 minutes for 3 items to get written to the second list.
Any ideas where to look for the slowdown?
Solved! Go to Solution.
How do you create the multiple items? Do you use a "Loop" action or a State Machine? This would explain the long duration, because these actions do not repeat immediately, but only after some delay, usually around 5 minutes.
If you can manage to create a collection variable, fill it with data from the first list using "query list", and use the "For each" action to create the items in the second list, it will run immediately.
Or go the "pragmatic" way, and have a bunch of serial actions, each one within an if condition which checks a counter variable, and pack this into a loop. That way you would be able to create a certain number (as many as you have serial actions) with no delay and only have the loop (and thus the delay) for bigger numbers of items
hope this helps
There is a loop that compares two number: number of items to create and number of items created. Number of items created is incremented for each loop until the two number match. Then the loop stops. I ran it yesterday for 50 items and it took 4 hours to complete with the Safe Looping enabled. Why would the For Each be any faster than a loop? Isn't it a loop as well?
To avoid the loop, I added serial actions that do the same thing to create up to 25 records. It's working extremely well. It created the records so fast that the start and stop emails didn't have time to come in. Thanks so much for this advice. While it is not elegant, it works!