© Anton Dolganin 2025
Why: Process arrays of tasks in parallel using serverless design. Perfect for batch processing (S3/SQS/DynamoDB), mass API calls, or report generation.
Best Practices:
Map
in distributed
mode (not inline
) if you have more than ~40 iterations.maxConcurrency
to avoid overloading dependencies.Use Case: You receive 1,000 orders → Step Function processes each in parallel, logging success/failure.
Example Map state fragment:
{
"Type": "Map",
"InputPath": "$.items",
"ItemsPath": "$",
"MaxConcurrency": 10,
"Iterator": {
"StartAt": "ProcessItem",
"States": {
"ProcessItem": {
"Type": "Task",
"Resource": "arn:aws:lambda:region:account:function:processItem",
"End": true
}
}
},
"End": true
}
Result: pass items: [1,2,3,4,...]
— and Step Functions fan-out and trigger processItem Lambda for each.
© Anton Dolganin 2025