Jacob Blanco
08/06/2024, 5:48 AMMarvin
08/06/2024, 5:48 AMJacob Blanco
08/06/2024, 5:49 AMMarvin
08/06/2024, 5:49 AMfrom prefect import get_client
from prefect.states import Cancelled
async def cancel_flow_run(flow_run_id):
async with get_client() as client:
await client.set_flow_run_state(flow_run_id, Cancelled())
3. Use Concurrency Limits: Set concurrency limits for the specific flow so that the flow runs don't get executed until resources become available. This can make the flow appear to be "hung" or delayed indefinitely. More information can be found here: https://docs.prefect.io/latest/guides/using-the-client/
By utilizing these strategies, you can effectively prevent specific flows from being executed from the UI. If further customization is needed, feel free to delve deeper into the Client API or explore Prefect's extensive documentation.
For more detailed control: Prefect Client Guide
If you encounter any issues, you may also refer to the relevant GitHub issues:
- Prevent running late runs after some threshold
- Increase visibility around maxed out concurrency limits
Let me know if you need further assistance!