States - Amazon Step Functions
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China.


Individual states can make decisions based on their input, perform actions, and pass output to other states. In Amazon Step Functions you define your workflows in the Amazon States Language. The Step Functions console provides a graphical representation of that state machine to help visualize your application logic.


If you define your state machines outside the Step Functions' console, such as in an editor of your choice, you must save your state machine definitions with the extension .asl.json.

States are elements in your state machine. A state is referred to by its name, which can be any string, but which must be unique within the scope of the entire state machine.

States can perform a variety of functions in your state machine:

  • Do some work in your state machine (a Task state)

  • Make a choice between branches of execution (a Choice state)

  • Stop an execution with a failure or success (a Fail or Succeed state)

  • Simply pass its input to its output or inject some fixed data (a Pass state)

  • Provide a delay for a certain amount of time or until a specified time/date (a Wait state)

  • Begin parallel branches of execution (a Parallel state)

  • Dynamically iterate steps (a Map state)

The following is an example state named HelloWorld that performs an Amazon Lambda function.

"HelloWorld": { "Type": "Task", "Resource": "arn:aws-cn:lambda:us-east-1:123456789012:function:HelloFunction", "Next": "AfterHelloWorldState", "Comment": "Run the HelloWorld Lambda function" }

States share many common features:

  • Each state must have a Type field indicating what type of state it is.

  • Each state can have an optional Comment field to hold a human-readable comment about, or description of, the state.

  • Each state (except a Succeed or Fail state) requires a Next field or, alternatively, can become a terminal state by specifying an End field.


    A Choice state may have more than one Next, but only one within each Choice Rule. A Choice state cannot use End.

Certain state types require additional fields, or may redefine common field usage.

After you have created and executed Standard Workflows, you can access information about each state, its input and output, when it was active and for how long, by viewing the Execution Details page in the Step Functions console. For more information, see Viewing and debugging executions on the Step Functions console

After you have created and executed Express Workflows, and if logging is enabled, you can access information about the execution in Amazon CloudWatch Logs.