Coordinating Services with AWS Step Functions
This lesson explains how Step Functions coordinates several services into serverless workflows defined as state machines.
Learning outcomes
After completing this lesson, you will be able to:
- Describe the states that make up a workflow.
- Choose between Standard and Express workflows.
- Explain how callback tokens let a workflow wait for people or systems.
- Choose between orchestration and choreography.
Building workflows
AWS Step Functions workflows are written in Amazon States Language, a JSON format, or built visually in Workflow Studio. They are made of states: Task states do work, Choice states branch, Parallel states run branches at once, Map states process each item in a list, Wait states pause, and Pass, Succeed and Fail states control flow. Distributed Map processes very large datasets, such as millions of objects in Amazon S3, with thousands of parallel child executions.
Built-in retries, catchers and error handling remove that logic from application code. Step Functions integrates directly with more than 200 AWS services, including Lambda, ECS and Fargate, AWS Batch, AWS Glue, SageMaker AI, DynamoDB, SNS and SQS, so many steps need no Lambda function at all. A process too long for Lambda's 15-minute limit is split into steps that the workflow coordinates.
Step Functions states
Standard or Express
Step Functions offers two workflow types. A Standard workflow can run for up to a year, runs each step exactly once, and keeps a full execution history that can be inspected step by step. It suits long-running business processes, such as order processing or a workflow that waits for a human approval.
An Express workflow runs for at most five minutes and is designed for high rates of execution at lower cost, such as processing each message from IoT devices or transforming streaming data; asynchronous Express workflows may run a step more than once, so steps should be idempotent. The following table summarises the differences.
Waiting for people or systems
A task with a callback token pauses (up to a year in Standard) until an external system or person returns the token, e.g. approving via an email link.
The following diagram shows an approval step that waits for a callback token.

Orchestration or choreography
When a process spans several services, they can be coordinated in two ways. With orchestration, a central coordinator, typically a Step Functions state machine, calls each service in turn and decides the next step from the result. The whole process is visible in one place, each execution can be inspected, and retries, error handling and compensating steps are defined centrally, which suits processes whose order, error handling and audit trail matter, such as payments.
With choreography, there is no coordinator: each service publishes events about what it has done, through EventBridge or SNS, and other services react independently. Services stay loosely coupled, and a new consumer can be added without changing the others, but the overall process is harder to see and to change. The following table summarises the choice.
| Approach | How | Choose when |
|---|---|---|
| Orchestration (Step Functions) | A central, visible sequence | Order, error handling and auditing of the whole process matter |
| Choreography (EventBridge, SNS) | Services react independently | Loose coupling matters most |
The following diagram compares the two approaches.

Orchestration or choreography?
An order workflow with a human step
A high-value order process must check stock, charge the card, wait up to two days for a manager's approval if the amount exceeds $10,000, then ship.
| Requirement | Step Functions feature |
|---|---|
| Steps in order with branching on the amount | Choice state |
| Retry the payment service on transient errors | Retry with backoff |
| Refund if shipping fails | Catch leading to a compensating step |
| Wait for a manager, up to two days | Task with .waitForTaskToken |
| Runs for days, exactly once | Standard workflow |
Writing this in a single Lambda function would be impossible, because Lambda runs for at most 15 minutes, and fragile, because the state would have to be stored and resumed by hand.
Which workflow type suits high-volume event processing that finishes within five minutes?
Show answer
An Express workflow, which is cheaper at high volume. Standard workflows run for up to a year and record a full execution history.
Exam Tips
Remember for the exam
- To orchestrate a multi-step process with retries, branching and human approval, use Step Functions.
- For long-running workflows lasting days use Standard; for high-volume short workflows use Express.
- To process thousands of S3 objects in parallel, use Distributed Map.
- When a workflow must wait for a manual approval, use a callback task token.
- For central control and visibility of a multi-step process, orchestrate it with Step Functions.