Skip to Content

AWS Step Functions

Visual serverless workflows with Step Functions, their states and integrations, human approval, and Standard vs Express workflows.

What it is

AWS Step Functions builds serverless visual workflows (state machines) that orchestrate Lambda functions and other AWS services.

Instead of one Lambda function calling the next and handling every error itself, the steps and their order are described in a workflow. Step Functions runs it, tracks each step, retries failures and shows the progress in the console.

A Step Functions workflow for an order: validate the order; a choice checks if it is in stock; if not, notify the customer; if yes, charge the payment and reserve the stock in parallel, then ship the order A Step Functions workflow for an order: validate the order; a choice checks if it is in stock; if not, notify the customer; if yes, charge the payment and reserve the stock in parallel, then ship the order

An order workflow with a choice and a parallel step.

Features

  • Sequence, parallel branches, conditions (choice), wait, and map (run a step for each item in a list).
  • Timeouts, retries and error handling (catch a failure and go to another state).
  • Integrations with Lambda, EC2, ECS, on-premises servers, API Gateway, SQS queues, DynamoDB and over 200 AWS services.
  • Human approval: a workflow can pause, send a task token (for example by email), and wait until a person approves before continuing.
  • The workflow is defined in JSON (the Amazon States Language) or drawn in the visual editor, Workflow Studio.

Use cases: order fulfilment, data processing, web applications, any workflow.

Standard vs Express workflows

  • Standard: runs for up to one year; exactly-once execution; full execution history for 90 days; priced per state transition. For long-running, auditable workflows (payments, order processing, human approval).
  • Express: runs for up to five minutes; at-least-once execution; very high volume; priced per execution and duration. For high-volume event processing, such as streaming data or IoT ingestion.

Not in the course slides

The slides cover Step Functions in one slide. Standard vs Express workflows come from the AWS documentation; they're useful when a question mentions duration or volume.

Real-world examples

  • An insurance claim workflow validates the claim, checks for fraud and waits for an adjuster's approval, sometimes for days: a Standard workflow.
  • A video pipeline transcodes a video into several formats in parallel with Lambda and ECS tasks, then updates a database.
  • An IoT backend runs a short Express workflow for each of 50,000 device messages a second.

Exam tips

  • "Orchestrate several Lambda functions", "visual workflow", "retries and error handling between steps" → Step Functions.
  • "Workflow needs human approval" → Step Functions (task token / callback).
  • "Long-running workflow, up to a year, exactly once" → Standard workflow.
  • "High-volume, short (under 5 minutes) event processing" → Express workflow.

Common traps

  • "Chain Lambda functions by calling each other." Hard to manage and retry; Step Functions orchestrates them.
  • "Step Functions can only call Lambda." It integrates with EC2, ECS, SQS, API Gateway, on-premises activities and many more.

Hands-on lab: a small workflow

Goal: run a workflow with a choice and a wait step, and watch it in the console.

Costs money

Standard workflows cost $0.025 per 1,000 state transitions, so a handful of runs cost far less than a cent. Any Region works.

Create the state machine

Step Functions → Create state machine → Create from blank. In Workflow Studio, drag a Choice state, a Wait state (3 seconds) on one branch, and Pass states named Approved and Rejected. Set the choice rule: if $.amount is less than 100, go to Wait → Approved; otherwise go to Rejected. Name it saa-workflow, type Standard, and create it with a new role.

Run it twice

Start execution with input {"amount": 50}, then again with {"amount": 500}. In the Graph view, the first run goes through Wait to Approved (green), the second straight to Rejected.

Expected result: two executions taking different paths, each step visible in the graph.

Clean up: delete saa-workflow and the IAM role it created.

AWS documentation

On this page

Open notes

Spotted a mistake?

These notes are open source. Suggest a fix, or star the repo if they helped you.

Suggest an edit

For AI agents: llms.txt · llms-full.txt