Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to prevent concurent runs of a state machine in AWS Step Functions?

Is there a way to prevent concurrent execution of AWS Step Functions state machines? For example I run state machine and if this execution is not finished and I run this machine again I get an exception.

like image 593
Cherry Avatar asked Oct 15 '25 17:10

Cherry


1 Answers

You can add a step (say, with a Lambda function) which would check if the same state machine is already being executed (and in which state). If this is the case, the lambda and the step would fail.

Depending on what you want to achieve, you can additionally configure a Retry so that the execution will continue once the old state machine has finished.

like image 130
lexicore Avatar answered Oct 18 '25 09:10

lexicore



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!