Problem Statement: I have 2 Lambdas in a State Machine, and I want the State Machine Invocation to FAIL in case of a Failure in any Lambda function. In case of Failure, I want the stateMachine to FAIL, and send the ERROR Object back in terms of
{"cause":"...", "error":"..."}
I am able to catch the error by introducing a state, and send it back. But, AWS is marking the StepFunction invocation as a SUCCESS. I want it to be marked as FAIL.
AS-IS: I have the stateMachine sitting behind an API Gateway, with methods "startExecution" & "DescribeExecution" defined in the Gateway
PS: I've already gone through this https://docs.aws.amazon.com/step-functions/latest/dg/tutorial-handling-error-conditions.html
Thanks in advance, any help much appreciated