https://prefect.io logo
Title
v

vholmer

10/28/2022, 2:44 PM
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?
k

Khuyen Tran

10/28/2022, 3:56 PM
Hmm. I’m in prefect 2.6.5 and this works for me:
import asyncio
from prefect.client import get_client
from prefect import flow, task, get_run_logger


@task
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()
        <http://logger.info|logger.info>(response)


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


if __name__ == "__main__":
    asyncio.run(parent_flow())
Which error did you get when running the task with
submit
?
v

vholmer

10/31/2022, 8:28 AM
@Khuyen Tran No error whatsoever. The task just isn't being run at all... 😞
k

Khuyen Tran

10/31/2022, 3:13 PM
Could you show more example of your code besides
await my_task.submit()
?
v

vholmer

11/01/2022, 3:05 PM
Sure! I just sent you a DM with some code, I can't really share it publicly unfortunately.