AWS · Application Integration

AWS Step Functions

A serverless workflow service that coordinates steps across AWS services as a state machine, with retries, branching and waiting built in.

On the SAA-C03 exam listWorkflow orchestrationServerless

What it is and what problem it solves

AWS Step Functions runs a workflow you define as a state machine in Amazon States Language (JSON), or draw in Workflow Studio. Each state can call a Lambda function or directly call many AWS services, run steps in parallel, branch on data, wait, loop over items with a Map state, and handle errors with retries and catch paths.

Step Functions keeps the workflow's state for you, so a process that takes seconds, hours or months survives failures and restarts without your own bookkeeping.

There are two workflow types. Standard workflows run up to a year, give exactly-once execution of each state, and keep a visible history. Express workflows run up to five minutes, are built for very high start rates, and run at-least-once.

Validate orderTask (Lambda)Amount > $5,000?ChoiceWait for approvaltask token (human)Parallelcharge card + reserve stockyesnoapprovedShipSucceedRefund + notifyCatch → Failerror after retries
A Step Functions workflow: branching, a human approval step, parallel tasks, retries and error handling

When to use it

  • A business process has several steps with ordering, branching, retries and compensation (for example order, payment, stock, shipping).
  • A process must wait for something: a human approval, a callback, a timer.
  • You want error handling and retries expressed as configuration instead of code in each function.
  • You process large batches in parallel with a Map state.
  • You need an audit trail of what happened in each execution.

When to avoid it

  • A single short function: a state machine adds cost and indirection with no benefit.
  • Simple one-to-many notification or queueing: SNS, SQS or EventBridge are simpler.
  • Heavy computation or long-running streaming inside the workflow itself: Step Functions coordinates work; it does not do it. Run the work in Lambda, ECS, Batch or another service.
  • Very high-volume, short, idempotent event handling might suit Express workflows or plain event rules better than Standard, which is priced per state transition.

Scaling model and bottlenecks

Standard workflows scale to a very large number of open executions, with account-level quotas on how fast executions can start and how fast states transition. Express workflows allow much higher start rates. A Distributed Map can fan out to many parallel child executions for batch processing.

Performance, latency and throughput

Each state transition adds overhead, so Standard workflows suit processes measured in seconds or longer. For high-rate, short workloads, Express workflows have far lower per-step overhead and a higher start rate.

Limits and quotas

Input and output data passed between states has a size limit; for large data, store it in S3 and pass a reference. Standard executions also have a maximum history length.

ItemValueContextSource
Maximum execution duration, Standard 1 year
Fixed limit
Source
checked
Maximum execution duration, Express 5 minutes
Fixed limit
Source
checked
Input or output size of a task, state or execution 256 KiB
Fixed limit
Source
checked
Execution history, Standard 25,000 events per execution
Fixed limit
Source
checked
StartExecution rate, Standard Bucket of 1,300 refilling 300 per second
Can be raised with a quota request
US East (N. Virginia), US West (Oregon) and Europe (Ireland); other Regions have a bucket of 800 refilling 150 per second. Source
checked
Open executions per account per Region 1,000,000
Can be raised with a quota request
Does not apply to Express workflows. Source
checked

Quotas and limits change. Check the linked source before designing around a number.

Cost model

What you pay for

  • Standard workflows: a charge per state transition, beyond a monthly free tier. Retries count as extra transitions.
  • Express workflows: a charge per request (each execution start) and for duration, billed by memory used.
  • The services your states call (Lambda, SQS, DynamoDB and so on) bill separately, as does data transfer.

Where it is cost-efficient

Long-running or infrequent processes with few steps, such as approvals and nightly jobs, where Standard workflow charges are small. Short, high-volume event processing is cheaper on Express workflows.

Where costs grow

  • Standard workflows with many states and loops, where every iteration is a transition.
  • High volumes of short executions on Standard instead of Express.
  • Polling loops built from wait and check states, instead of waiting for a callback.

Cost controls and common surprises

Choose Express for high-volume short work, use direct service integrations to skip glue Lambda functions, use callbacks rather than polling loops, and pass references to large data instead of the data itself.

Prices differ by Region and change over time; see the pricing page linked under Sources.

Security

Controls the service provides

  • IAM execution role for each state machine: it can only call what the role allows.
  • Encryption in transit and at rest, with the option of a customer-managed KMS key.
  • Resource-based policies can control who may start executions across accounts.

What you configure

Give each state machine a role scoped to the exact actions and resources its states use, restrict who can start or change state machines, and avoid putting secrets in state input or output, since they appear in execution history; read secrets from Secrets Manager inside the task.

Logging and monitoring

CloudWatch Logs and X-Ray tracing can be turned on per state machine; Standard executions keep a history, and Express executions need logging to be inspected.

Related security services

IAM, KMS, CloudTrail, CloudWatch, Secrets Manager.

Shared responsibility

AWS runs the workflow engine. You own the definition, the role's permissions, and what data moves through the workflow.

Availability, backup and failure behavior

Step Functions is a regional, managed service that records each state's progress durably, so an execution continues after transient failures and can be resumed ("redriven") from a failed step. Define retries with backoff and catch paths in the workflow for the failures you expect, and keep tasks idempotent because a step may run more than once.

Common service combinations

API Gateway or EventBridge to start executions; Lambda, ECS/Fargate and Batch for work; SQS and SNS for messaging; DynamoDB for state and idempotency; S3 for large payloads; Athena, Glue and SageMaker AI in data and ML pipelines.

Business application examples

  • An order saga: reserve stock, charge the card, create the shipment, and refund and release stock if a later step fails.
  • A document pipeline: extract text, classify, wait for human review, then archive.
  • A nightly data workflow that starts a job, waits for completion and notifies on failure.

Exam cues and common confusions

  • Coordinate several steps with retries, branching and waiting: Step Functions.
  • Standard vs Express: Standard for long, auditable, exactly-once workflows (up to a year); Express for high-volume, short (up to five minutes) workloads.
  • Human approval or callback: a task token (wait for callback pattern).
  • Process a large dataset in parallel: a Map state (Distributed Map for very large scale).
  • Step Functions vs SQS or SNS: Step Functions orchestrates a process; the others move messages.

Related

Courses and lessons

Services, comparisons and patterns

Sources

Independent study material, not affiliated with or endorsed by Amazon Web Services. AWS and service names are trademarks of Amazon.com, Inc. or its affiliates.

Last reviewed · By the ByteCamel team · How we write content

Was this page helpful?

Report a mistake