The following common pattern os using Promise.all and array.map(Promise) does not use a Parallel state. It should.
Doing this generally would be difficult (maybe impossible) without type information. Perhaps we can implement a heuristic to detect this pattern.
new StepFunction(
stack,
"SendMessageBatch",
async (input: { messages: OrderPlacedEvent[] }) => {
await Promise.all(
input.messages.map(async (message) => {
await orderQueue.sendMessage({
MessageBody: message,
});
})
);
}
);