import yaml


def is_workflow(workflow_content: bytes) -> bool:
    """Takes CWL file contents and checks whether it is a CWL Workflow
    (and not an ExpressionTool or CommandLineTool).

    Args:
        workflow_content: a dict structure parsed from a CWL file.

    Returns:
        True iff the top-level Process in this CWL file is an
                instance of Workflow.
    """
    try:
        workflow = yaml.safe_load(workflow_content.decode())
    except yaml.scanner.ScannerError:  # type: ignore
        return False
    except yaml.parser.ParserError:  # type: ignore
        return False

    if 'class' not in workflow:
        return False
    if 'inputs' not in workflow or 'outputs' not in workflow:
        return False
    if 'steps' not in workflow:
        return False

    process_class = workflow.get('class')
    return process_class == 'Workflow'