Pass States
The Pass state ("Type": "Pass"
) passes input to output and does no work.
Primarily a Pass is used to manipulate a run's data or to act as a terminal success state (the opposite of a Fail state).
Pass states may contain a ResultPath
, a JSONPath expression indicating
where the input should be placed in the output from the state.
If given an InputPath
, a Pass state takes its input from a particular
location in the flow run's current data.
Pass states may also contain a Result
, containing static output data.
Pass states are also useful as terminal success states, for example after a Choice state.
Fields
The following fields are the valid parameters to a Pass state.
InputPath
-
A JSONPath expression, indicating a source in the run's current data. This is most useful when combined with
ResultPath
. ResultPath
-
A JSONPath expression, indicating a source in the run's current data. This is most useful when combined with
ResultPath
. Result
-
A static payload to use as the state output.
Next
-
The string name of the next state.
End
-
If set to
true
, the run terminates with a success upon reaching this state.
Either "End": true
or Next
must be set.
Examples
This Pass state specifies an InputPath
and a ResultPath
, which means it
effectively moves data round.
{
"Type": "Pass",
"InputPath": "$.DataOrigin",
"ResultPath": "$.DataDestination",
"Next": "AfterPass"
}
This means that if the run's data, upon reaching this state is
{
"DataOrigin": "0 degrees North by 0 degrees West",
"DataTransitMethod": "Sneakernet"
}
then the run's data upon exiting this state, and transitioning to the
"AfterPass"
state, will be
{
"DataDestination": "0 degrees North by 0 degrees West",
"DataTransitMethod": "Sneakernet"
}
This Pass
state puts all of the input data into the field named
"Nested"
, then transitions to the state named "AfterPass"
:
{
"Type": "Pass",
"ResultPath": "$.Nested",
"Next": "AfterPass"
}
This is a simple successful end state for a flow, phrased as a Pass
:
{
"Type": "Pass",
"End": true
}