def _populate_wf_data(wf_def, wf_data):
    """
    Populate the workflow data in the workflow definition

    Args:
        wf_def (dict): workflow definition
        wf_data (dict): workflow data to be populated into workflow definition

    Returns:
        dict: workflow definition with the workflow data populated
    """
    if not wf_data["arguments"]:
        return wf_def
    if not wf_def["spec"]["arguments"]:
        wf_def["spec"]["arguments"] = {}

    if "parameters" in wf_data["arguments"]:
        wf_def["spec"]["arguments"]["parameters"] = wf_data["arguments"][
            "parameters"]
    if "artifacts" in wf_data["arguments"]:
        wf_def["spec"]["arguments"]["artifacts"] = wf_data["arguments"][
            "artifacts"]

    return wf_def