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

StandardExpress
Max duration1 year5 minutes
Pricingper state transitionper request + duration
Execution historyFull, queryableCloudWatch Logs only
Invocation modesAsync onlyAsync or sync
Use caseLong-running, auditableHigh-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

TypePurpose
TaskDo work — invoke Lambda, call AWS service, run activity
ChoiceBranch on input
ParallelRun N branches concurrently, all must finish
MapIterate over an array (inline or distributed)
WaitSleep for a duration or until a timestamp
PassNo-op; transform state
Fail / SucceedTerminal 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 calls SendTaskSuccess/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-outParallel or Map state 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.waitForTaskToken for human approval, third-party callbacks, or async batch jobs.

See also

References