Introduction

AWS Step Functions is a serverless orchestration service. Orchestration is the coordination of several separate tasks into a single, reliable process. A workflow is the ordered sequence of those tasks. This guide explains what Step Functions is, the problem it was created to solve, how a workflow is defined and executed, and the situations in which it is appropriate.

What is it?

Step Functions coordinates multiple AWS services and functions into a workflow that is defined as a state machine. A state machine is a description of a workflow as a set of states and the transitions between them. A state is a single step in the workflow, for example a unit of work to perform or a decision to make. A transition is the movement from one state to the next. The workflow is written in the Amazon States Language, a format based on JavaScript Object Notation, known as JSON, which is a text format for structured data.

Why does it exist?

A business process is often composed of many steps that must be run in order, with decisions between them, retries when a step fails, and a record of what has happened. If this coordination is written by hand inside application code, the result is frequently complex and difficult to maintain. Step Functions was created so that the coordination is described declaratively, separate from the logic of each step. Retries, error handling, and the passing of data between steps are then managed by the service.

How it works

An execution begins with an input and moves from state to state until it reaches an end state. Several state types are available. A Task state performs work, most often by invoking a Lambda function or by calling an AWS service directly. A Choice state selects the next state based on the data. A Parallel state runs several branches at the same time. A Map state runs the same steps for each item in a list. A Wait state pauses for a period, and the Succeed and Fail states end the execution.

Each state can define retry and catch rules so that failures are handled without additional code. Data is passed from one state to the next, and portions of that data can be selected using JSONPath, a syntax for addressing parts of a JSON document. Two workflow types are offered. Standard workflows are durable and auditable, and Express workflows are optimized for high volume and short duration.

Architecture diagram

Start | v [ Task ] --> invokes a Lambda function or an AWS service | v [ Choice ] --> selects the next state based on the data | \ | \--> [ Task ] (alternative branch) v [ Parallel / Map ] --> runs branches or list items together | v End (Succeed or Fail). Retry and Catch rules handle errors.

Advantages

Disadvantages

Common use cases

Best practices

Common mistakes

Further reading in this library

Frequently Asked Questions

What is a state machine?
A state machine is a definition of a workflow as a set of states and the transitions between them. In Step Functions, it describes the sequence of steps that an execution follows, including the work performed, the decisions made, and the handling of errors.
What is the Amazon States Language?
The Amazon States Language is a JSON-based format in which a Step Functions state machine is defined. It describes the states, their order, and their error handling.
What is the difference between Standard and Express workflows?
Standard workflows are durable, may run for up to one year, and record the full execution history. Express workflows are optimized for high volume and short duration and are billed differently. The choice depends on duration, volume, and auditing needs.
How is AWS Step Functions priced?
Standard workflows are charged per state transition. Express workflows are charged by the number of executions, their duration, and the memory used.
Can Step Functions call services other than AWS Lambda?
Yes. In addition to invoking Lambda functions, Step Functions can call many AWS services directly from a Task state.
Mastering AWS Step Functions cover
Go deeper ยท Book as a Service™
Mastering AWS Step Functions

This article is the summary. The book is the full, continuously updated reference: state machine design, the Amazon States Language, error handling, and production orchestration patterns.

View the book