https://prefect.io logo
#prefect-server
Title
# prefect-server
s

Sharath Chandra

04/18/2022, 6:12 AM
Hi, I have a master flow for orchestration. I want to trigger one of the downstream flow even if some tasks in the upstream flow has failed. Is this possible to have the https://docs.prefect.io/api/latest/triggers.html#functions at the flow level ?
a

Anna Geller

04/18/2022, 10:52 AM
If you use create_flow_run and wait_for_flow_run tasks instead of StartFlowRun, you can add
raise_final_state=False
to continue downstream child flows from parent even if the child flow run fails
k

Kevin Kho

04/18/2022, 1:33 PM
Hey Sharath, when you get a chance, could you move the code to the thread to keep the main channel cleaner
👍 1
s

Sharath Chandra

04/18/2022, 1:36 PM
Copy code
flow_1 = StartFlowRun(flow_name="", project_name=project_name, wait=False)

flow_1_run = flow_1(
    parameters={
        "Run date (before offset)": run_date,
        "Date offset": date_offset,
        "Mode": mode,
        
    },
)


flow_2 = StartFlowRun(flow_name="", project_name=project_name, wait=False)

flow_2_run = flow_2(
    parameters={
        
    },
    upstream_tasks=[flow_1_run],
)

flow_3 = StartFlowRun(flow_name="", project_name=project_name, wait=False)

flow_3_run = flow_3(
    parameters={
        "Run date (before offset)": run_date,
        "Date offset": date_offset,
        "Mode": mode,
        
    },
    upstream_tasks=[flow_2_run],
)
This is code for reference
@Anna Geller Thanks, will check this
👍 1
4 Views