Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS Step Function: custom end state for choices

I have a choice state like below:

"ChoiceStateX": {
  "Type": "Choice",
  "Choices": [
    {
      "Not": {
        "Variable": "$.type",
        "StringEquals": "Private"
      },
      "Next": "Public"
    },
    {
      "Variable": "$.value",
      "NumericEquals": 0,
      "Next": "MyEndState"  // can I do something like this? 
    },
}

For the state with $.value == 0, I need to end the step function, because Choices does NOT support End: true, I need explicitly to have something like MyEndState.

So how should I define MyEndState inside the step function? Is there a such way?

like image 260
user1187968 Avatar asked Jun 07 '26 14:06

user1187968


1 Answers

What I do in that case is add a PassState that has End: true, and send the Next of the ChoiceState to that state.

like image 72
Jason Wadsworth Avatar answered Jun 10 '26 09:06

Jason Wadsworth



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!