Question:
The below step function is executed in aws and when there is a missing of a required parameter it cancel the flow and throws States.Runtime Error. This is in catch phase of the step function but it is not catching the error as stated.
Defined Step function is as below,
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
{ "StartAt": "Log Start Step Function", "Comment": "Executed with inputs", "States": { "Log Start Step Function": { "Type": "Task", "Resource": "arn:aws:lambda:eu-west-1:0000000:function:update", "Parameters": { "body": { "itemID.$": "$.itemID", "functionName.$": "$.stepFunctionName ", "executionARN.$": "$.Execution.Id", "complete": false, "inprogress": true, "error": false } }, "Catch": [ { "ErrorEquals": [ "States.Runtime" ], "ResultPath": "$.taskresult", "Next": "Log Failed Module" }, { "ErrorEquals": [ "States.ALL" ], "ResultPath": "$.taskresult", "Next": "Log Failed Module" } ], "ResultPath": "$.taskresult", "Next": "Evaluate Module PA1" } } } |
And the error thrown is as below,
Runtime error is not executing Log failed module.
1 2 3 4 5 6 7 8 |
{ "ErrorEquals": [ "States.Runtime" ], "ResultPath": "$.taskresult", "Next": "Log Failed Module" }, |
Is this AWS error or something wrong with the configuration which is done here or is there any other way to validate parameters in AWS Step Functions
Answer:
From https://docs.aws.amazon.com/step-functions/latest/dg/concepts-error-handling.html
A States.Runtime error is not retriable, and will always cause the execution to fail. A retry or catch on States.ALL will not catch States.Runtime errors.