def _validate_workflow_var_format(value: str):
    """Validate workflow vars."""
    add_info = ''
    parts = value.split('.')
    if len(parts) == 2:
        typ, attr = parts
        if attr not in ('name', 'id'):
            add_info = (
                'The only valid workflow variables with two segments are workflow.name and workflow.id.'
                )
    elif len(parts) == 4:
        typ, attr, prop, _ = parts
        if attr in ('inputs', 'outputs'):
            if prop not in ('parameters', 'artifacts'):
                add_info = (
                    'Workflow inputs and outputs variables must be "parameters" or "artifacts".'
                    )
        elif attr == 'operators':
            if parts[-1] != 'image':
                add_info = (
                    'Workflow operator variable can only access the image name.'
                    )
        else:
            add_info = (
                'Workflow variables must reference to "inputs", "outputs" or "operators".'
                )
    else:
        add_info = 'Workflow variables are either 2 or 4 segments.'
    return add_info
