Thread
#prefect-community
    Prudhvi Kalakota

    Prudhvi Kalakota

    8 months ago
    Hi everyone, how do I name these tasks so that visually they appear with proper names ``````
    Kevin Kho

    Kevin Kho

    8 months ago
    You can do:
    with Flow("parent-flow", schedule=weekday_schedule) as flow:
        
        # assumes you have registered the following flows in a project named "examples"
        flow_a = create_flow_run(flow_name="A", project_name="examples", task_args=dict(name="some_name"))
    Could you move the code to the thread when you get the chance to keep the main channel a bit more compact?
    Prudhvi Kalakota

    Prudhvi Kalakota

    8 months ago
    from prefect import Flow
    from prefect.schedules import CronSchedule
    from prefect.tasks.prefect import create_flow_run, wait_for_flow_run
    
    
    weekday_schedule = CronSchedule(
        "30 9 * * 1-5", start_date=pendulum.now(tz="US/Eastern")
    )
    
    
    with Flow("parent-flow", schedule=weekday_schedule) as flow:
        
        # assumes you have registered the following flows in a project named "examples"
        flow_a = create_flow_run(flow_name="A", project_name="examples")
        wait_for_flow_a = wait_for_flow_run(flow_a, raise_final_state=True)
        
        flow_b = create_flow_run(flow_name="B", project_name="examples")
        wait_for_flow_b = wait_for_flow_run(flow_b, raise_final_state=True)
        
        flow_c = create_flow_run(flow_name="C", project_name="examples")
        wait_for_flow_c = wait_for_flow_run(flow_c, raise_final_state=True)
        
        flow_d = create_flow_run(flow_name="D", project_name="examples")
        wait_for_flow_d = wait_for_flow_run(flow_d, raise_final_state=True)
        
        flow_b.set_upstream(wait_for_flow_a)
        flow_c.set_upstream(wait_for_flow_a)
        flow_d.set_upstream(wait_for_flow_b)
        flow_d.set_upstream(wait_for_flow_c)
    Thanks @Kevin Kho . Will try it out
    Kevin Kho

    Kevin Kho

    8 months ago
    Thank you!