serverless aws orchestration claude-curated
AWS Step Functions is a serverless workflow orchestrator. You define a state machine in JSON (Amazon States Language, ASL), and the service runs it — invoking AWS Lambda functions, AWS service APIs, or other workflows, with built-in retries, error handling, and visual execution history.
Two workflow types
| Standard | Express | |
|---|---|---|
| Max duration | 1 year | 5 minutes |
| Pricing | per state transition | per request + duration |
| Execution history | Full, queryable | CloudWatch Logs only |
| Invocation modes | Async only | Async or sync |
| Use case | Long-running, auditable | High-volume, short, event processing |
Standard is the default for human-paced or hour-scale work — order processing, batch coordination, data pipelines. Express is built for high-TPS, short workflows — IoT event handling, API request fan-out, stream processing.
Amazon States Language (ASL)
A state machine is a JSON document with a States map. Example skeleton:
{
"StartAt": "Validate",
"States": {
"Validate": {
"Type": "Task",
"Resource": "arn:aws:states:::lambda:invoke",
"Parameters": { "FunctionName": "validate", "Payload.$": "$" },
"Next": "Decide"
},
"Decide": {
"Type": "Choice",
"Choices": [{ "Variable": "$.ok", "BooleanEquals": true, "Next": "Done" }],
"Default": "Fail"
},
"Done": { "Type": "Succeed" },
"Fail": { "Type": "Fail" }
}
}State types
| Type | Purpose |
|---|---|
Task | Do work — invoke Lambda, call AWS service, run activity |
Choice | Branch on input |
Parallel | Run N branches concurrently, all must finish |
Map | Iterate over an array (inline or distributed) |
Wait | Sleep for a duration or until a timestamp |
Pass | No-op; transform state |
Fail / Succeed | Terminal states |
Distributed Map (a Map variant) handles up to 10,000 concurrent child executions and is the right tool for large fan-outs over S3 inventories.
Error handling
Every Task and Parallel state can declare:
- Retry — list of error patterns with backoff parameters (
IntervalSeconds,MaxAttempts,BackoffRate, jitter). - Catch — fall through to a named state on matching errors.
"Retry": [{ "ErrorEquals": ["States.TaskFailed"], "MaxAttempts": 3, "BackoffRate": 2 }],
"Catch": [{ "ErrorEquals": ["States.ALL"], "Next": "HandleFailure" }]This pushes resilience out of application code and into the workflow definition.
Service integrations
Step Functions can call 50+ AWS services directly via optimised and AWS SDK integrations — Lambda, ECS/Fargate run-task, DynamoDB, SNS, SQS, Glue, EMR, EventBridge, Athena, Bedrock, and more. Two invocation styles:
- Request-response — fire and continue.
.sync— wait for the called service to finish (e.g. wait for an ECS task to exit)..waitForTaskToken— pass a token to an external system; the workflow pauses until that system callsSendTaskSuccess/SendTaskFailure. Powers human-approval steps.
Common patterns
- Saga — a sequence of Task states where each has a compensating “rollback” Task in its Catch path. Implements distributed transactions without two-phase commit.
- Parallel fan-out —
ParallelorMapstate runs branches concurrently, results aggregated. - Recursive workflows — a state machine starts another execution of itself (or a child workflow) for chunked processing.
- Wait-for-callback —
.waitForTaskTokenfor human approval, third-party callbacks, or async batch jobs.