AWS Step Functions Intro


Step Functions is a diagram based system to manage complex state based functions that utilize various AWS microservices. It is a “serverless orchestration service”. It allows for branching, error handling, parallel processing and service integration.

step functions diagram

📘 AWS Step Functions Documentation

📘 Step Functions Data Flow Simulator

Amazon States Language

A JSON based language that is used to manage the state in Step Functions.

📘 Amazon States Language

It used to be the case that all step functions had to be written by hand with this language, however now there is a GUI called Workflow Studio which allows you to assemble step functions (partially) with a gui and then assembled the majority of the step function language for you.

State Types


A Pass state "Type": "Pass" passes its input to its output, without performing work. Pass states are useful when constructing and debugging state machines.


A Task state "Type": "Task" represents a single unit of work performed by a state machine.

All work in your state machine is done by tasks. A task performs work by using an activity or an AWS Lambda function, or by passing parameters to the API actions of other services.

The Amazon States Language represents tasks by setting a state’s type to Task and by providing the task with the Amazon Resource Name (ARN) of the activity or Lambda function.

A Task state must set either the End field to true if the state ends the execution, or must provide a state in the Next field that is run when the Task state is complete.


A Choice state "Type": "Choice" adds branching logic to a state machine.


A Wait state "Type": "Wait" delays the state machine from continuing for a specified time. You can choose either a relative time, specified in seconds from when the state begins, or an absolute end time, specified as a timestamp.


A Succeed state "Type": "Succeed" stops an execution successfully. The Succeed state is a useful target for Choice state branches that don’t do anything but stop the execution.

Because Succeed states are terminal states, they have no Next field, and don’t need an End field, as shown in the following example.

"SuccessState": {
  "Type": "Succeed"


A Fail state "Type": "Fail" stops the execution of the state machine and marks it as a failure, unless it is caught by a Catch block.


The Parallel state "Type": "Parallel" can be used to create parallel branches of execution in your state machine.


The Map state "Type": "Map" can be used to run a set of steps for each element of an input array. While the Parallel state executes multiple branches of steps using the same input, a Map state will execute the same steps for multiple entries of an array in the state input.

Input and Output Processing

The output of a state becomes the input into the next state. However, you can restrict states to working on a subset of the input data by using Input and Output Processing.

In the Amazon States Language, these fields filter and control the flow of JSON from state to state:

  • InputPath
  • OutputPath
  • ResultPath
  • Parameters
  • ResultSelector

The following diagram shows how JSON information moves through a task state. InputPath selects which parts of the JSON input to pass to the task of the Task state (for example, an AWS Lambda function). ResultPath then selects what combination of the state input and the task result to pass to the output. OutputPath can filter the JSON output to further limit the information that’s passed to the output.

input and output json data flow diagram

InputPath, Parameters, ResultSelector, ResultPath, and OutputPath each manipulate JSON as it moves through each state in your workflow.

Each can use paths to select portions of the JSON from the input or the result. A path is a string, beginning with $, that identifies nodes within JSON text. Step Functions paths use JsonPath syntax.

📘 Step Functions Data Flow Simulator