BookatlasTwo-Day MuleSoft → Salesforce Bootcamp
180 / 1048 · Module 6 — Mule Routing and Orchestration← prev⊞ allnext →

6.11Parallel For Each

Now suppose the items are independent.

Instead of:

C001
 ↓
wait
 ↓
C002
 ↓
wait
 ↓
C003

you may use:

Parallel For Each

C001 ─────→ process
C002 ─────→ process
C003 ─────→ process

Conceptually:

await Promise.all(
    customers.map(processCustomer)
);

Mule's Parallel For Each processes collection elements concurrently and then routes the aggregated result onward. (docs.mulesoft.com)