AWSDOP-C02
On this page
Beginner-friendly overview

Step Functions

Step Functions is AWS's serverless workflow orchestration service. It lets you coordinate multiple AWS services — Lambda functions, ECS tasks, DynamoDB operations, API calls — into a reliable, visual workflow where each step only runs when the previous one succeeds.

The Orchestration Problem

As applications grow, business processes get complex. Placing an order might involve validating the cart, charging the card, checking inventory, reserving items, scheduling fulfillment, sending a confirmation, and notifying the warehouse. Each step can fail. Steps might need to run in parallel. Some steps depend on the results of others.

You could write all this logic in a single Lambda function, but then you're writing code to handle retries, timeouts, branching, and parallel execution yourself. And if the Lambda function times out 14 minutes in (Lambda's maximum is 15 minutes), you lose all progress. Step Functions handles all of this for you and persists state, so a workflow can run for up to a year.

State Machines

Workflows in Step Functions are defined as state machines — a set of states (steps) connected by transitions. Each state describes what to do (invoke a Lambda, wait for a human, run a task in parallel, make a choice) and where to go next.

Common state types:

  • Task — invoke a Lambda function, call an API, run an ECS task, query DynamoDB
  • Choice — branch based on a condition (like an if/else)
  • Parallel — run multiple branches simultaneously and wait for all to finish
  • Wait — pause the workflow for a fixed time or until a timestamp
  • Map — process each item in an array through the same set of steps

Express vs Standard Workflows

Standard workflows persist every state transition, support workflows up to one year, and guarantee exactly-once execution. They're priced per state transition and are right for long-running, critical business processes.

Express workflows are designed for high-volume, short-duration workloads (up to five minutes). They're priced per execution-duration and are much cheaper per invocation, but they don't guarantee exactly-once execution.

The Visual Debugger

One of Step Functions' most practical benefits is the console's visual execution history. For any past execution, you can see exactly which states ran, what data flowed through each one, where failures occurred, and what the error was. Debugging a multi-step workflow becomes straightforward compared to searching through logs.