Hey @Jenny (sorry for tagging you again, this seems to be the best way to get messages seen in this channel, lmk if there is a better option)
I'm stuck on trying to figure out a reliable way to cancel a flow with subflows with python.
I can cancel a parent flow via the api, via the cli, and via the UI, and in all three cases, my subflows are left in the running state.
I can cancel each of them via the CLI, when i copy and paste their id's.
I haven't been able to figure out how to get the subflow id's from the api response of the parent flow.
Do you think you could help me figure out a solution for this? flow and subflow cancellation is a must for our app
j
Jenny
05/30/2023, 4:25 PM
Hi! I'm in back to back meetings so sorry for the short reply. I did a draft PR to the docs which I think should answer you question: https://github.com/PrefectHQ/prefect/pull/9753
Basically, there are two types of sub-flow-run. One is kicked off from inside your flow (let's call them standard sub-flow-runs) and the other is kicked off by calling run_deployment.
We are working on improving the flow-run/sub-flow-run cancellation experience so that standard sub-flow-runs are deleted when their parent is deleted.
If you prefer to be able to cancel sub-flow-runs independently, I recommend using run_deployment.
n
Nicholas Torba
05/30/2023, 4:43 PM
ah, so I call my subflows within my parent flow with the run_deployment func?
Nicholas Torba
05/30/2023, 4:43 PM
that allows for cancellation to work correctly?
Nicholas Torba
05/30/2023, 4:48 PM
wait, does that mean I have to create deployments for each of the flows I want to create as subflows?
yess 1
Nicholas Torba
05/30/2023, 4:50 PM
sorry, just re-read.
when you have the chance, can you share the PR that is working on the cancellation of standard subflow runs?
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.