https://prefect.io logo
Title
d

David Elliott

10/25/2022, 3:47 PM
Apologies if I’ve missed this somewhere obvious (quite likely!) but is it not possible to cancel a flow run from the 2.0 UI?
1
k

Khuyen Tran

10/25/2022, 4:27 PM
There is no current way to do it besides deleting the flow run. We are working on adding Cancel to a flow run
d

David Elliott

10/25/2022, 4:44 PM
OK, thanks!
Don’t suppose there’s any very rough timeline for that is there? Atm deleting a flow run in the UI causes the flow run to crash out non-gracefully, and I was hoping to be able to add some logic for when the run gets cancelled (which requires it to return cancelled gracefully). I guess I could (presumably) cancel it via the CLI or API, but just wondering if there’s any expectation on that UI functionality?
z

Zanie

10/25/2022, 5:22 PM
There is a rough timeline actually, we plan to add this in the next month. We do not check for cancellation at this time in the engine, so if you change the flow run’s state to Cancelled nothing will happen unless it attempts to perform a state transition i.e. if you do it before it is Running it will not run but otherwise it will not see it has been cancelled until it is finished.
There’s a rough sketch of within-flow monitoring for its own cancellation in https://github.com/PrefectHQ/prefect/pull/7150 — but we’re still designing this feature.
👍 1
d

David Elliott

10/25/2022, 5:30 PM
Ah! that’s good to know, thanks (re flow states). OK cool, thanks for the update 👍