How to set the number of threads in a Parallel For Each?


I need to use a Parallel For Each activity to call a WS (because the answer for each call is taking more than 1 minute). But how can you control the number of threads in order not to overload the web service? (for example limit the activities in parallel to 100).

Thank you in advance !

We don’t have a control on how many threads it will be created when parallel for each is triggered.

As per the Microsoft documentation,

It schedules the work on multiple threads based on the system environment. The more processors on the system, the faster the parallel method runs.

Karthik Byggari