Amazon EventBridge to redrive AWS Step Functions failed state

EventBridge → AWS Lambda → StepFunctions

Create an EventBridge rule to redrive a Step Fucntions workflow from a failed state

Proactively detect workflow failures and initiate a Step Functions redrive, this elminiates the need to restart a workflow from the begnining.

< Back to all patterns

GitHub icon Download this pattern (.zip)

GitHub icon View this pattern on GitHub


Clone repo

git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/eventbridge-sfn-redrive

Deploy

sam deploy --guided


Testing

Use the AWS CLI to send a test event to EventBridge and observe the event delivered to the Lambda function:
1. Send an event to EventBridge: aws events put-events --entries file://event.json.
2. Retrieve the logs from the Lambda function: sam logs -n ENTER_YOUR_CONSUMER_FUNCTION_NAME.

Cleanup

1. Delete the stack: sam delete --stack-name STACK_NAME.
2. Confirm the stack has been deleted: aws cloudformation list-stacks --query "StackSummaries[?contains(StackName,'STACK_NAME')].StackStatus"

Created by:

Benjamin Smith

Benjamin Smith

Ben is a senior developer advocate for Serverless Applications at Amazon Web Services based in London, UK. Prior to joining AWS Ben worked in a number of different technical roles specializing in workflow Automation and web development.

Follow on LinkedIn