with Flow('new flow') as flow:
    new_task.set_upstream(tasks=upstream_flow.reference_tasks)

    # or
    new_task.set_upstream(flow=upstream_flow)