Step function startExecution task not returning http meta data

0

I have a step function in which I have a task where I start execution of another step function. It usually returns the HTTP meta data (SdkHttpMetadata to be specific) in the output and I use the HTTP status in it to determine the Choice state I have next. But since May 4th, the output only contains ExecutionArn and StartDate, so the Choice state is failing.

        "StartTimer": {
            "Type": "Task",
            "Resource": "arn:aws:states:::states:startExecution",
            "Parameters": {
                "StateMachineArn": "${TimerArn}",
                "Input": {
                    "AWS_STEP_FUNCTIONS_STARTED_BY_EXECUTION_ID.$": "$$.Execution.Id"
                }
            },
            "Next": "Success?"
        },
        "Success?": {
            "Type": "Choice",
            "Choices": [
                {
                    "Variable": "$.SdkHttpMetadata.HttpStatusCode",
                    "NumericEquals": 200,
                    "Comment": " Yes",
                    "Next": "AssignTask"
                },
                {
                    "Not": {
                        "Variable": "$.SdkHttpMetadata.HttpStatusCode",
                        "NumericEquals": 200
                    },
                    "Next": "FailedToStartTimer",
                    "Comment": "No"
                }
            ]
        },
Kaung
asked 23 days ago89 views
1 Answer
1

Hi kaung,

Please Try the below script once it will helpfull to you.

"StartTimer": {
    "Type": "Task",
    "Resource": "arn:aws:states:::states:startExecution",
    "Parameters": {
        "StateMachineArn": "${TimerArn}",
        "Input": {
            "AWS_STEP_FUNCTIONS_STARTED_BY_EXECUTION_ID.$": "$$.Execution.Id"
        }
    },
    "Next": "HandleStartExecutionResponse"
},
"HandleStartExecutionResponse": {
    "Type": "Pass",
    "Result": {
        "ExecutionArn.$": "$.ExecutionArn"
    },
    "ResultPath": "$.StartExecutionResponse",
    "Next": "CheckStartExecutionStatus"
},
"CheckStartExecutionStatus": {
    "Type": "Choice",
    "Choices": [
        {
            "Variable": "$.StartExecutionResponse",
            "IsPresent": true,
            "Next": "AssignTask"
        },
        {
            "Variable": "$.StartExecutionResponse",
            "IsPresent": false,
            "Next": "FailedToStartTimer"
        }
    ]
},

answered 23 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions