Step Functions coordinates multiple AWS services into serverless workflows. Instead of writing complex orchestration code with retry logic and error handling, you define a state machine and Step Functions handles the coordination.
Order Processing Workflow:
[Start]
|
v
[Validate Payment] -- Fail --> [Send Failure Email] --> [End]
|
v
[Reserve Inventory] -- Fail --> [Refund Payment] --> [Send Failure Email] --> [End]
|
v
[Parallel State] -- runs these simultaneously:
|-- [Send Confirmation Email]
|-- [Update Analytics]
|-- [Generate Invoice]
v
[Wait 24h] -- scheduled wait state
|
v
[Dispatch Order]
|
v
[End]
| Feature | Standard Workflow | Express Workflow |
|---|---|---|
| Duration | Up to 1 year | Up to 5 minutes |
| Execution model | Exactly once | At-least once |
| State history | Full audit log | CloudWatch Logs only |
| Pricing | Per state transition | Per execution duration |
| Best For | Long-running business processes, order management | High-volume event processing, IoT |
| Cost | $0.025 per 1,000 transitions | $0.00001 per state transition |
Step Functions can call 200+ AWS services directly without a Lambda function wrapper:
# Direct SDK Integration examples (no Lambda needed):
DynamoDB.PutItem -- Write to DynamoDB directly
SQS.SendMessage -- Send to SQS queue
ECS.RunTask -- Start an ECS task
SageMaker.CreateTrainingJob -- Start ML training
Glue.StartJobRun -- Start ETL job
SNS.Publish -- Send notification
# Reduces cost and latency vs wrapping in Lambda