📡 You're offline — showing cached content
New version available!
Quick Access
Tutorials AWS Solutions Architect Step Functions

Step Functions

4 min read Quiz at the end
Use Step Functions to orchestrate complex multi-service workflows with error handling, parallel execution, and wait states.

Step Functions — Orchestrating Complex Workflows

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.

Teacher Note: Without Step Functions, imagine coordinating an order: Lambda 1 validates payment, Lambda 2 reserves inventory, Lambda 3 ships order, Lambda 4 sends confirmation. If Lambda 2 fails, you need code to: retry, handle partial failures, rollback Lambda 1. Step Functions handles ALL of this automatically.

State Machine Workflow Example

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]

Standard vs Express Workflows

FeatureStandard WorkflowExpress Workflow
DurationUp to 1 yearUp to 5 minutes
Execution modelExactly onceAt-least once
State historyFull audit logCloudWatch Logs only
PricingPer state transitionPer execution duration
Best ForLong-running business processes, order managementHigh-volume event processing, IoT
Cost$0.025 per 1,000 transitions$0.00001 per state transition

Built-in SDK Integrations

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
Exam Tip: Step Functions is the recommended solution for orchestrating multi-step workflows with error handling, retries, and parallel execution. The visual workflow console makes debugging straightforward — you can see exactly which state failed and why, which is impossible with custom coordination code.