I am currently using Prefect 2 on AWS, running a flow periodically that launches an EC2 instance, executes a shell script, and then terminates the EC2 instance. However, when the flow enters a Crashed state, there are times when the shutdown process of the EC2 instance fails.
As a result, I am considering implementing a flow to periodically shut down unnecessary EC2 instances. In order to do this, I would like to know if there is a way to “retrieve information about other flow runs (e.g., IDs and statuses)”.
If there is a way to retrieve information about other flow runs, how can I implement it, and are there any other points I should be aware of?
Thank you in advance for your help.