AWS Step Function Path Tool

Tool for developing and understanding path manipulations in AWS Step Functions

Graph of an example step function

|

Step Functions are a serverless AWS service used for robustly chaining together various services (such as Lambda functions), using state machine logic for branching and loops.

When plugging the output of one state into the input of another, you may want to do some simple manipulations of the data. For example, you may query DynamoDB in the first task, to fetch a database row as a dictionary, then you want to extract a particular column from that row, to pass as part of the input to a Lambda function execution. Step Functions allows you to implement such manipulations natively, using a subset of JSONPath.

The exact behavior of these path arguments can be hard to remember, particularly the order of each one, what null means, and how multiple paths interact. Reading the documentation to figure out the nuance can be time consuming, or unclear. Creating and executing trivial step functions to figure this out by trial and error is time consuming. Furthermore since Pass states don't support all fields, you cannot easily test them all.

Fill out the fields below with the input you want to pass to a state, and modify or disable each field as you see fit. The state output, raw task input, and intermediate fields will be updated instantly.

Note: Several months after I created this tool, Amazon released an identical tool in the Step Functions console.

If you spot behavior that does not match official Step Function behavior, please submit an issue on GitHub .


Warning: this tool may not work properly on your browser. Try using the latest version of Firefox, Chrome or Edge. (Not Internet Explorer.)

State Input Payload:

This is the raw input to the state, which comes from the output of the previous state.

Type your input here.

[0,{"b": "B"},2,3]

Input not valid JSON. If you want to specify a string literal, wrap in double quotes.

InputPath

Select a simple subset of the input to use.

Documentation for InputPath

$

Warning: null is not the same as omitting InputPath. null means that an empty dictionary will be used instead of the input. If you want to omit InputPath, untick the box above.

InputPath should start with a $

Intrinsic Functions are not supported in this web page.

The following field is what the input looks like after the InputPath is applied, and before any Parameters field is applied. If there is no Parameters field, this is what will be passed to the task (e.g. Lambda function).

{}

Parameters

Manipulate the input data, possibly in a complex way.

Documentation for Parameters field

{"data.$": "$"}

Parameters value is not valid JSON. If you want to specify a string literal, wrap in double quotes.

Warning: null is not the same as omitting Parameters. null means that an empty dictionary will be used instead of the input. If you want to omit Parameters, untick the box above.

Intrinsic Functions are not supported in this web page.

The following field is what happened after the Parameters field was applied. This is what will be sent to the task (e.g. Lambda function).

Loading...

Result (or task output)

For a Pass task, this is the output of the task, prior to OutputPath, ResultPath or ResultSelector.

For a different task (e.g. Lambda function), set this equal to what you expect the output of the task is. (e.g the return value of the Lambda function.)

Any $ in this field will not be evaluated using JSONPath, they will be treated as literal strings.

{}

Result value is not valid JSON. If you want to specify a string literal, wrap in double quotes.

The Result field must be hard coded. Any $ values will be treated as literal strings with dollar signs.

Warning: null is not the same as omitting Result. null means that an empty dictionary will be used instead of the task output. If you want to omit Result, (using the input instead) change your selection above.

Intrinsic Functions are not supported in this web page.

Assuming this is a Pass task. The result will be equal to the state input after InputPath and Parameters have been applied.

ResultSelector

Manipulate the raw task output, before combining it with the original input.

Documentation for ResultSelector

Note that ResultSelector is not supported for Pass states, only Map, Parallel and Task.

{}

ResultSelector value is not valid JSON.

Warning: null is not the same as omitting ResultSelector. null means that an empty dictionary will be used instead of the task output. If you want to omit ResultSelector, change your selection above.

Intrinsic Functions are not supported in this web page.

This is what the output looks like after ResultSelector is applied.

Loading...

ResultPath

Choose where in the original state input you want to add the result. Or discard the input and replace with the result by using null.

Documentation for ResultPath

$[1].abc

Warning: null is not the same as omitting ResultPath. null means that the output of the task will be discarded, and the input will be used instead. (That is, the input before InputPath and Parameters.) If you want to omit ResultPath, untick the box above.

ResultPath should start with a $

Intrinsic Functions are not supported in this web page.

The following field is what the input looks like after the ResultPath is applied.

Loading...

OutputPath

After possibly combining the input and output, choose a subset to return from the whole state.

Documentation for OutputPath

$

Warning: null is not the same as omitting OutputPath. null means the output of the whole state will be {}. If you want to omit OutputPath, untick the box above.

InputPath should start with a $

Intrinsic Functions are not supported in this web page.

The following field is what the input looks like after the OutputPath is applied.

Loading...