def has_workflow_stage(artifact, workflow_step_name):
    """
    Checks that the artifact's sample's root artifact has been through the given workflow.
    :return True if it has False otherwise
    """
    for w, status, name in artifact.samples[0].artifact.workflow_stages_and_statuses:
        if name == workflow_step_name and status == 'COMPLETE':
            return True
    return False