def METHOD_NAME(self, context):
    workfile_instance = None
    other_instances = []
    for instance in context:
        # Skip inactive instances
        if not instance.data.get("publish", True):
            continue
        version_doc = instance.data.get("versionEntity")
        if not version_doc:
            self.log.debug(
                "Instance {} doesn't have version.".format(instance))
            continue
        family = instance.data.get("family")
        if family == "workfile":
            workfile_instance = instance
        else:
            other_instances.append(instance)
    return workfile_instance, other_instances