Skip to content

Does Step Functions provide events to EventBridge after each step?

0

As in a title, is there a way to configure EvetBridge for my State Machine to receive events after each step? I want to know if my steps are passed correctly or to get details about them like duration etc. to persist then inside my own database.

Thanks for any answer.

asked 2 years ago869 views
2 Answers
3
Accepted Answer

Hi,

You can leverage the Amazon EventBridge service integration for AWS Step Functions to achieve what you want: see https://aws.amazon.com/blogs/compute/introducing-the-amazon-eventbridge-service-integration-for-aws-step-functions/ for all details.

Reference doc is here: https://docs.aws.amazon.com/step-functions/latest/dg/connect-eventbridge.html

Best,

Didier

EXPERT
answered 2 years ago
EXPERT
reviewed 2 years ago
  • Thanks @Didier for your answer, I will use it. But I think that it will be really helpful for developers to get info about each step in a more proper way, without set a separate tasks for them. This should be as an option in EventBridge rule settings.

  • Hi, I agree that it could become a config parameter to require Step Functions service to do it automatically. I'll check if it comes. Thanks for accepting my answer!

  • This answer is correct and instrumenting your workflows with events like this is the way to go. However, if you are simply looking to have access to all of the history from your workflow executions, you can also look at enabling logging to CloudWatch Logs: https://docs.aws.amazon.com/step-functions/latest/dg/cw-logs.html This will send all History Events to CloudWatch logs which you can use as the database of information (should you be looking to get it all) and you can also process those logs to prepare statistics for your application.

2

=>Enable CloudWatch Events for your state machine in Step Functions.

=>Create an EventBridge rule with the appropriate event pattern to capture the desired events.

=>Choose a target to send these events to (like Lambda, SNS, etc.).

=>This setup ensures that you receive events in EventBridge after each step in your Step

=> Functions state machine, allowing you to persist the details in your own database.

EXPERT
answered 2 years ago
  • I was trying but it sent me events just on changing status of the whole execution process, there's no events about the steps inside this execution, can you maybe send me event pattern?

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.