Back to results for “Auto Scaling Groups”
AWS › AWS Step Functions

How does the Map state in Step Functions support processing a large collection of items in parallel or sequentially?

Intermediate

Answer

The Map state lets you apply the same set of processing steps to every item within an input array, either running iterations in parallel up to a configurable concurrency limit for faster overall processing, or sequentially if the order matters or downstream systems cannot handle high concurrency, making it well suited for scenarios like processing a batch of uploaded files or applying the same validation logic to every item in an order.
{
  "Type": "Map",
  "ItemsPath": "$.orderItems",
  "MaxConcurrency": 5,
  "Iterator": {"StartAt": "ProcessItem", "States": {"ProcessItem": {"Type": "Task", "Resource": "arn:aws:lambda:..."}}}
}
Real-world example An order fulfillment workflow uses a Map state to process every item in a customer's order in parallel, checking inventory availability for each item simultaneously rather than checking them one at a time sequentially, significantly speeding up order processing.

Common follow-ups: How does the MaxConcurrency setting affect downstream system load?;What is the difference between the standard Map state and the newer Distributed Map state for very large datasets?