AWS Systems Architect Professional

AWS Step Functions State Machines – SAP-C02 Study Guide

Learn how to design and run AWS Step Functions state machines using Amazon States Language, workflow states, executions, and common exam decision points.

AWS Systems Architect ProfessionalAWS Systems Architect ProfessionalUpdated Sep 1, 2026
Study options
WatchComing later
ListenComing later
ReadAvailable
ReviewComing later

Study guide

Technical reference and lesson notes

Purpose of This Lesson

AWS Step Functions is a serverless workflow orchestration service. It coordinates a sequence of states that can perform processing, make decisions, wait, run tasks in parallel, or terminate successfully or unsuccessfully.

This lesson demonstrates how to create and execute a simple state machine using the AWS Management Console and Amazon States Language.

Key Concepts

State machines

A state machine is a workflow definition. It describes:

  • The starting state
  • The states that make up the workflow
  • Transitions between states
  • Conditions that determine the next state
  • How the workflow ends

State machines can be created from scratch, based on AWS-provided templates, or from an example such as the Hello World workflow.

Executions

An execution is a single run of a state machine. The Step Functions console provides a visual execution history so you can inspect the progression of the workflow and identify which states ran.

A single state machine can have many executions over time. The definition describes the workflow; each execution represents one instance of that workflow processing input.

Amazon States Language

State machines are defined using Amazon States Language, commonly represented as JSON. The definition specifies the workflow structure and state behavior.

A simplified example is:

{
  "StartAt": "ValidateInput",
  "States": {
    "ValidateInput": {
      "Type": "Pass",
      "Next": "Complete"
    },
    "Complete": {
      "Type": "Succeed"
    }
  }
}

The visual workflow editor and the code editor represent the same state machine definition in different ways. Definitions can also be imported when a workflow has already been authored as Amazon States Language.

Common state types shown in the example

#### Pass state

A Pass state performs no external work. It can pass input to the next state and is useful for:

  • Testing workflow transitions
  • Providing placeholder processing
  • Injecting or transforming simple data in a workflow definition
  • Building a workflow skeleton before adding real tasks

#### Choice state

A Choice state evaluates conditions and selects one of multiple branches. The example uses a Boolean condition that leads to a yes or no path.

Choice states are useful when workflow behavior depends on input or the result of an earlier task, such as routing a request based on validation, status, or business rules.

#### Wait state

A Wait state pauses workflow execution for a configured period or until a specified time. It is useful when a process must delay before checking a condition, polling for an external result, or continuing to a later stage.

#### Parallel state

A Parallel state runs multiple branches as part of the same workflow. It is appropriate when independent activities can proceed concurrently rather than sequentially.

The workflow continues after the parallel branches complete, subject to the behavior defined in the state machine.

#### Succeed and Fail states

Terminal states end an execution explicitly:

  • Succeed marks the execution as successful.
  • Fail marks the execution as failed and can provide error and cause details.

A workflow can use these states after decision branches or validation steps to make the final outcome explicit.

Task processing

The demonstration workflow contains structural states and does not perform meaningful business processing. In a production state machine, a task state can invoke or coordinate work such as:

  • An AWS Lambda function
  • An AWS service integration
  • An activity or other supported Step Functions integration

This separation allows Step Functions to orchestrate work without requiring the workflow itself to contain the application logic.

Exam-Relevant Takeaways

  • AWS Step Functions provides visual, serverless orchestration for multi-step workflows.
  • A state machine is the workflow definition; an execution is one run of that definition.
  • Amazon States Language is used to define state machines and is commonly written in JSON.
  • Pass is useful for testing or passing data without invoking external processing.
  • Choice creates conditional branches.
  • Wait introduces a delay or waits until a configured time.
  • Parallel executes independent branches concurrently.
  • Succeed and Fail explicitly terminate an execution.
  • A workflow can combine orchestration states with task states that invoke Lambda or integrate with other AWS services.
  • The Step Functions console supports visual authoring, code-based editing, templates, and execution inspection.

Architecture Decision Guide

RequirementStep Functions feature or stateDesign consideration
Model a workflow visuallyState machine and Workflow Studio/editorUseful for understanding transitions and troubleshooting execution paths
Pass through data or create a placeholder stepPassDoes not perform application work by itself
Route execution based on input or a previous resultChoiceDefine conditions and provide an appropriate default path where needed
Delay processing or poll laterWaitAvoid unnecessary compute while the workflow is paused
Run independent operations concurrentlyParallelUse when branches are independent and can safely execute at the same time
Mark a workflow as completeSucceedExplicit successful terminal state
Mark a workflow as unsuccessfulFailExplicit failed terminal state; include useful failure context
Invoke application logicTask state, such as Lambda integrationKeep business logic in the task and orchestration logic in Step Functions
Inspect a workflow runExecution history and visual graphReview state transitions and failures for operational troubleshooting
Reuse an existing workflow definitionAmazon States Language importValidate the JSON definition and required integrations before deployment

Common Exam Traps

  • Confusing a state machine with an execution: The state machine is reusable; an execution is a particular run.
  • Assuming every state performs work: Pass, Choice, Wait, Succeed, and Fail primarily control workflow behavior. Application processing generally belongs in a task or service integration.
  • Treating Choice as parallel processing: Choice selects a branch. Parallel runs multiple branches.
  • Using a delay mechanism unnecessarily: A Wait state can pause a workflow without keeping a compute resource continuously running.
  • Assuming the visual editor is a separate workflow language: The visual representation and code view describe the same Amazon States Language definition.
  • Ignoring terminal paths: Every possible branch should eventually reach an appropriate next state or terminal state.
  • Using a placeholder workflow as production logic: A Hello World or template state machine demonstrates structure but does not necessarily implement real application behavior.

Real-World Engineer Notes

  • Start with the workflow’s state transitions and failure paths before adding application-specific tasks.
  • Use meaningful state names so execution histories are understandable during incident analysis.
  • Keep orchestration decisions in Step Functions and domain processing in Lambda or integrated AWS services.
  • Use Choice states for explicit business routing rather than embedding all control flow inside one Lambda function.
  • Use Parallel only when branches are genuinely independent and their completion behavior is acceptable for the workflow.
  • Test state transitions with representative input, including values that exercise every choice branch and failure path.
  • Treat the state machine definition as deployable infrastructure. Store it in source control, review changes, and deploy consistently across environments.

Quick Reference Summary

  • Service: AWS Step Functions
  • Primary purpose: Serverless workflow orchestration
  • Workflow definition: State machine
  • Workflow run: Execution
  • Definition language: Amazon States Language, commonly JSON
  • Conditional routing: Choice
  • Delay: Wait
  • Concurrent branches: Parallel
  • Placeholder or pass-through: Pass
  • Successful termination: Succeed
  • Failed termination: Fail
  • Application work: Task states and AWS service integrations

Flashcards

  1. Q: What is an AWS Step Functions state machine?

A: A definition of a workflow, including its states, transitions, conditions, and terminal outcomes.

  1. Q: What is an execution?

A: One run or instance of a state machine.

  1. Q: What language defines Step Functions workflows?

A: Amazon States Language, commonly expressed in JSON.

  1. Q: What does a Pass state do?

A: It passes input through the workflow without performing external processing and is useful for testing or placeholders.

  1. Q: Which state selects a path based on conditions?

A: Choice.

  1. Q: Which state pauses workflow execution?

A: Wait.

  1. Q: Which state runs multiple branches concurrently?

A: Parallel.

  1. Q: What is the difference between Succeed and Fail?

A: Succeed ends the execution successfully; Fail ends it unsuccessfully.

  1. Q: Where does business processing typically occur in a Step Functions workflow?

A: In task states that invoke Lambda functions or integrate with AWS services.

  1. Q: What does the Step Functions execution view provide?

A: A visual representation and history of the states traversed during a particular execution.

Practice Questions

Question 1

A solutions architect is designing a workflow that validates an input, routes valid and invalid requests differently, and then ends each route with an explicit outcome. Which Step Functions states are most appropriate?

A. Parallel, followed by two Wait states
B. Choice, followed by Succeed or Fail
C. Pass, followed by Parallel only
D. Wait, followed by Choice and no terminal state

Correct answer: B

Explanation: A Choice state evaluates the validation result and selects a branch. Succeed and Fail explicitly represent the final outcomes.

Question 2

A workflow needs to start two independent processing activities at the same time and continue after both branches finish. Which state should be used?

A. Choice
B. Wait
C. Parallel
D. Pass

Correct answer: C

Explanation: A Parallel state runs multiple branches concurrently. Choice selects one path, while Wait delays execution and Pass does not perform concurrent processing.

Question 3

A team wants to test state transitions before implementing the Lambda functions that will eventually perform the business operations. Which state is most useful as a placeholder?

A. Pass
B. Fail
C. Parallel
D. Wait

Correct answer: A

Explanation: A Pass state can represent a workflow step without invoking external processing, making it useful for building and testing the workflow structure.

Question 4

A developer edits a Step Functions workflow in the visual console and then views its JSON representation. What does the JSON represent?

A. A separate Lambda deployment package
B. An Amazon States Language definition of the same state machine
C. A CloudFormation-only template
D. An execution log that cannot be imported

Correct answer: B

Explanation: Step Functions state machines are defined using Amazon States Language. The visual editor and code view represent the same workflow definition, which can also be imported when authored externally.

Question 5

A workflow must pause before checking whether an external process has completed. The architect wants to avoid keeping a compute function running during the delay. Which Step Functions capability addresses this requirement?

A. Wait state
B. Pass state
C. Choice state only
D. Succeed state

Correct answer: A

Explanation: A Wait state pauses the workflow for a configured duration or until a specified time, allowing the workflow to delay without continuously running application compute.