Tutorial 7: Configure input and output - 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 (PDF).

Tutorial 7: Configure input and output

A Step Functions execution receives a JSON text as input and passes that input to the first state in the workflow. Individual states in a workflow receive JSON data as input and usually pass JSON data as output to the next state. By default, data passes from one state to the next state in the workflow unless you’ve configured the input and/or output for one or more states in the workflow. Understanding how the information flows from state to another, and learning how to filter and manipulate this data, is key to effectively designing and implementing workflows in Step Functions.

Step Functions provides multiple filters to control the input and output data flow between states. The following filters are available for use in your workflows:

Note

Based on your use case, you may not need to apply all of these filters in your workflows.

InputPath

Selects WHAT portion of the entire input payload to be used as a task’s input. If you specify this field, Step Functions first applies this field.

Parameters

Specifies HOW the input should look like before invoking the task. With the Parameters field, you can create a collection of key-value pairs that are passed as input to an Amazon Web Service integration, such as an Amazon Lambda function. These values can be static, or dynamically selected from either the state input or the workflow context object.

ResultSelector

Determines WHAT to choose from a task's output. With the ResultSelector field, you can create a collection of key-value pairs that replace a state’s result and pass that collection to ResultPath.

ResultPath

Determines WHERE to put a task's output. Use the ResultPath to determine whether the output of a state is a copy of its input, the result it produces, or a combination of both.

OutputPath

Determines WHAT to send to the next state. With OutputPath, you can filter out unwanted information, and pass only the portion of JSON data that you care about.

Tip

The Parameters and ResultSelector filters work by constructing JSON, whereas the InputPath and OutputPath filters work by filtering specific nodes within a JSON data object, and the ResultPath filter works by creating a field under which the output can be added.

For more information about configuring input and output in your workflows, see Input and Output Processing in Step Functions.