Reputation: 5118
I am running step functions with two choices in AWS Step Functions.
...
"ChoiceState": {
"Type" : "Choice",
"Choices": [
{
"Variable": "$[0].input",
"NumericEquals":1,
"Next": "FirstMatchState"
},
{
"Variable": "$[0].input",
"NumericEquals":2,
"Next": "SecondMatchState"
}
],
"Default": "DefaultState"
},
...
choice state entered with this input
//ChoiceStateEntered
{
"name": "ChoiceState",
"input": 1
}
Error thrown
{
"error": "States.Runtime",
"cause": "An error occurred while executing the state 'ChoiceState' (entered at the event id #7). Invalid path '$[0].input': The choice state's condition path references an invalid value."
}
Upvotes: 1
Views: 5284
Reputation: 305
Simply, you do not need $[0] but $. Per your input, you should use $.input instead of $[0].input
Upvotes: 3