I'm trying to add some error handling to my step functions state machine and I've been having issues on a specific scenario, for example if I have a fail on a step I have a catch to send it to another function, but in that function I need to perform logic using the last step input data (the one that failed), however, I just receive an error, is there a way to pass the input data with the error as well?
Send Notification:
Type: Task
Resource: !GetAtt CommunicationSendCertifiedEmail.Arn
Retry:
- ErrorEquals:
- TierOneError
IntervalSeconds: 2
MaxAttempts: 9
BackoffRate: 1.5
- ErrorEquals:
- TierTwoError
IntervalSeconds: 4
MaxAttempts: 6
BackoffRate: 1.5
- ErrorEquals:
- TierThreeError
IntervalSeconds: 4
MaxAttempts: 3
BackoffRate: 2
- ErrorEquals:
- States.Timeout
- States.Runtime
- States.TaskFailed
- Lambda.ServiceException
IntervalSeconds: 4
MaxAttempts: 3
BackoffRate: 2
Catch:
- ErrorEquals:
- States.ALL
Next: Send Email Notification
on that "Send email notification" is where I need the input before the execution failed, but as I stated before I just get something like this:
{
"Error": "Error",
"Cause": "{\"errorType\":\"Error\",\"errorMessage\":...
}
I would like to get something like this:
{
"data": "{...}",
"Error": "Error",
"Cause": "{\"errorType\":\"Error\",\"errorMessage\":...
}
Any ideas? Is it even possible?


