Common error handling

Catch error from multiple states with a single common error handling state

Use a common error reporting task within a Step Functions workflow. People often want to use a single common error reporting task within their Step Functions workflow so that they don't have to duplicate the functionality across many different states. The challenge with this approach is that while that common error reporting task can get the error message from whatever state failed, it doesn't actually get the name of the state that failed. This is a challenge if you have two dozen different Lambda functions, and you're not sure which one caused the error. These example workflows work around this problem in two different ways.

< Back to all workflows

GitHub icon View this workflow on GitHub


Clone repo

git clone https://github.com/aws-samples/step-functions-workflows-collection/tree/main/common-error-handling/cd step-functions-workflows-collection/common-error-handling

Deploy

sam deploy --guided


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

1. Delete the stack: sam delete.

Additional resources

Created by:

Adam Wagner

Adam Wagner

AWS - Principal Serverless Solutions Architect

Follow on LinkedIn