Skip to content

get_task_run_result with a Failed task #5906

Answered by Pofilo
Pofilo asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, I overloaded get_task_run_result in another task checking the flow state.

@task(trigger=all_finished)
def get_flow_result(
    flow_run_view: "backend.FlowRunView", flow_run_id: str, task_slug: str
) -> Any:
    """
    Task that run no matter what thanks to the "all_finished" trigger.
    To be used instead of "get_task_run_result()" to make sure that the next
    flow/task is not run even if the flow failed.

    The problem comes from "get_task_run_result()" task which is run even if the
    previous flow failed and seems to reset the global state (further flows and tasks
    will be run because "get_task_run_result()" is in Success state).

    Instead of 2 parameters about the f…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Pofilo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants