TeeKay
TeeKay

Reputation: 1065

Choice State not pointing to Next State - AWS

I have the following step function. The Execution is failing in the Choice State.

"States": {
    "Process": {
        "Type": "Task",
        "Resource": "arn:aws:lambda:us-east-1:123:function:dummy1",
        "OutputPath": "$",
        "Next": "ChoiceStatePre"
    },

    "ChoiceStatePre": {
        "Type": "Choice",
        "Choices": [{
            "Variable": "$.status_pre",
            "Next": "Series0",
            "NumericEquals": 1
        }, {
            "Variable": "$.status_pre",
            "Next": "MatchStatePre",
            "NumericEquals": 8
        }]
    },
    "MatchStatePre": {
        "Type": "Task",
        "Next": "PreProcess",
        "Resource": "arn:aws:states:us-east-1:123:activity:dummy2"
    },
    "Series0": {
        "Resource": "arn:aws:lambda:us-east-1:123:function:dummy3",
        "Type": "Task",
        "InputPath": "$.seq0.step0",
        "ResultPath": "$.seq0.step0",
        "OutputPath": "$",
        "Next": "ChoiceStateTrigger0"
    }
}

Error -

{
"error": "States.Runtime",
"cause": "An error occurred while executing the state 'ChoiceStatePre' 
(entered at the event id #7). Failed to transition out of the state. The 
state does not point to a next state."
}

I already have a next state for it, but the error says that the Choice State is not pointing to any next state.

Upvotes: 4

Views: 2658

Answers (1)

Ramdev Sharma
Ramdev Sharma

Reputation: 1014

While looking into 'ChoiceStatePre', I didn't see Default state. It seems the root cause of this failure. Please add Default state and try again. Something like this:

"DefaultState": { "Type": "Fail", "Cause": "No Matches!" }

Upvotes: 5

Related Questions