Some Java Guy
Some Java Guy

Reputation: 5118

AWS Step Function returns condition path references error

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

Answers (1)

G. Bahaa
G. Bahaa

Reputation: 305

Simply, you do not need $[0] but $. Per your input, you should use $.input instead of $[0].input

Upvotes: 3

Related Questions