The Core State Types: Task, Choice, Parallel, Map
~10 min read
The building blocks every Step Functions workflow is composed from.
A Task state performs actual work — most commonly invoking a Lambda function, but also supporting direct SDK integrations with dozens of other AWS services (starting a Glue job, putting an item in DynamoDB, publishing to SNS) without needing a Lambda function as an intermediary at all. A Choice state evaluates conditions against its input and branches to different next states accordingly, implementing conditional logic natively in the workflow definition rather than inside application code. A Parallel state runs multiple defined branches simultaneously, waiting for all of them to complete (or handling a failure in any branch) before proceeding — useful when independent steps (like checking inventory and validating payment) don't depend on each other's results. A Map state runs the same sequence of steps once for every item in an input array, either concurrently (up to a configurable concurrency limit) or sequentially, which is the natural fit for processing a batch of items (like every line item in an order) without hand-writing a loop in application code.
💬 Deep Dive with AI
Key points
- •Task: does the actual work, often a Lambda invocation or a direct AWS service SDK call
- •Choice: native conditional branching based on the state's input
- •Parallel: runs multiple independent branches simultaneously, waits for all to finish
- •Map: runs the same steps once per item in an input array, concurrently or sequentially