A couple of options to explore
- Looking into a queue mechanisme is very useful.
- Try not to loop over the entire amount of lots, but use batches
- Look into other performance improvements
- Use different transactions (community commons)
- In your process store an attribute that holds when the entire process has finished and in your SE microflow check if this is between the currentdatetime and the previous start time. If not, skip this cycle (otherwise it keeps piling up..)
you can enhance this by implement these steps, the first one is to use the batches, and the second one to use the task queue on the sub MF.basically if you use the task queue in your MF, the retrieved record (which is 1000 record in your case) will split and each thread in the task queue will hold a number of record, so if we create a task queue with 2 threads, each thread will take 500 record and proceeded it in parallel.