I’ve just created a parent flow of flows and it se...
# ask-community
k
I’ve just created a parent flow of flows and it seems like when I cancel the parent flow, the child flow that it’s running doesn’t get cancelled and continues to run. Is there a way for me to pass the cancellation down to the children flow level?
k
Hey @Ken Nguyen, I don’t believe so, but let me double check with the team.
Yeah confirmed it can’t be done. There is just no route for these to be chained with automations. The best thing you can do is to periodically check if the parent is cancelled in the child flow run (maybe attach this check to the tasks as a state handler)
k
Got it, thank you! Would be quite useful to have an option to pass cancellation down the chain via an argument in the StartFlowRun() 🤔.
k
I’ll elevate the feedback, but this is likely a massive change that won’t happen for 1.0 and will be looked at in Orion
a
@Ken Nguyen maybe not entirely reacting to Cancellation specifically, but based on the discussion here https://prefect-community.slack.com/archives/CL09KU1K7/p1634566909479600 you can use the following task to solve it: https://gist.github.com/anna-geller/536496302924fba809e0f590d1e1d8a5 this way, if a child flow gets cancelled, the parent flow will immediately fail and won’t proceed with any downstream tasks
z
This is in the latest release.