Hi, I'm running a task that creates a flow run fro...
# prefect-community
Hi, I'm running a task that creates a flow run from a deployment ID using create_flow_run_from_deployment. I used to run the following code in prefect 2.5.0:
await my_task.submit(_flow_name_=FLOW_NAME, _env_=env, _run_name_=run_name, _wait_for_=[preprocess], _parameters_=parameters)
However after upgrading to 2.6.5 my_task isn't even being run. My workaround is to just run this:
await my_task(_flow_name_=FLOW_NAME, _env_=env, _run_name_=run_name, _wait_for_=[preprocess], _parameters_=parameters)
But it seems really weird that submit should have stopped working. Has anyone else ran into this issue?
Hmm. I’m in prefect 2.6.5 and this works for me:
Copy code
import asyncio
from prefect.client import get_client
from prefect import flow, task, get_run_logger

async def child_flow():
    async with get_client() as client:
        depl_id = "b8159391-e141-400b-93f3-0b1009513d81"
        response = await client.create_flow_run_from_deployment(depl_id)
        logger = get_run_logger()

async def parent_flow():
    await child_flow.submit()

if __name__ == "__main__":
Which error did you get when running the task with
@Khuyen Tran No error whatsoever. The task just isn't being run at all... 😞
Could you show more example of your code besides
await my_task.submit()
Sure! I just sent you a DM with some code, I can't really share it publicly unfortunately.