Rob McInerney

    4 months ago
    Hi! I’m trying to configure reference tasks for a flow with case statements and having some difficulty. Despite tasks failing, the flow is still succeeding. What am I doing wrong? Code follows the following example:
    with Flow(FLOW_NAME, storage=set_storage(FLOW_NAME), run_config=set_run_config(),) as flow:
        dataset = Parameter("dataset", default={})
        dataset_is_valid = check_dataset_is_valid(dataset)
        with case(dataset_is_valid, True):
            access_token = get_access_token()
            response = refresh_dataset(dataset, access_token)
            result = check_result(dataset, response, access_token)
            flow.set_reference_tasks([response, result])
        with case(dataset_is_valid, False):
    Both refresh_dataset and check_result are failing at the moment, but the flow is succeeding
    Kevin Kho

    Kevin Kho

    4 months ago
    I don’t think you can do it this way.
    is a task but the
    is not. I am not even sure if it runs or not. I think you can do:
    flow.set_reference_tasks([response, result, dataset_is_valid])
    at the end of the Flow block. Anyway, the other stuff will be SKIPPED which would be considered a success.

    Rob McInerney

    4 months ago
    Ok understood, I’ll give that a go!
    Tested and that works fine. Thanks for the help