I am running some processing in parallel that includes api calls.The result with then populate an interface attended by a user.
I have tried both a!forEach and MNI but for both the performance is not as expected.
By looking at the performance tab in the expression rule, it is clear that the items in the array are running sequentially and not in parallel,
as the total time for the expression rule is the sum of every iteration. As a test I tried to put only a GET api call in the foreach loop and the result is the same.
This is not what I was expecting, is there anything that can be done to enforce the threads to run in parallel to optimize the performance?
Discussion posts and replies are publicly visible
If foreach and MNI both are not helping, you can creating process model using parallel paths for each api call - basically call each api call independent of each other using AND node and a separate path per API. After the calls you can use complex node to ensure process returns to UI only after all the API executions are complete.
The problem is that I do not know how many paths I need, the content of the array depends of a previous api call.
Can you share the code of your expression?