<@ULVA73B9P> I have subflows start with run deploy...
# ask-marvin
m
@Marvin I have subflows start with run deployments and I have a statement that awaits the futures in the form of
awaited = await asyncio.gather(*futures, return_exceptions=True)
in the parent flow, but my parent flows says completed even though the subflows are still in a running state. Why is this happening?
m
Your issue might be caused by how subflows behave in Prefect. According to the Prefect documentation: Subflows will block execution of the parent flow until completion. This means you should not see a completed parent flow if the subflows are still running. However, if you are starting subflows using deployments and then awaiting their completion using
asyncio.gather()
, you might run into issues where the parent flow doesn't correctly track the state of these subflows. It's worth noting that subflows behave like independent flow runs in the backend, and if spawned via deployments, they might not synchronize state updates back to the parent as expected. For better control, ensure you're managing the states of these subflows properly, possibly by: 1. Monitoring subflow states directly. 2. Adding retries or state-checking mechanisms within the parent flow. For more detailed information, you can refer directly to Prefect's documentation on flows and subflows. If the problem persists, feel free to provide more specific details or consult this related GitHub issue for more context.
n
hey @Mitch - any chance you're open to showing a minimal example of your flow here?
m
@Nate Sorry, the issue had to do with having a backoff limit specified > 0 and certain K8 settings.
👍 1