public function getWorkflowFor($item, $includeComplete = false)
    {
        $id = $item;

        if ($item instanceof WorkflowAction) {
            $id = $item->WorkflowID;
            return DataObject::get_by_id(WorkflowInstance::class, $id);
        } elseif (is_object($item) && ($item->hasExtension(WorkflowApplicable::class)
                || $item->hasExtension(FileWorkflowApplicable::class))
        ) {
            $filter = sprintf(
                '"TargetClass" = \'%s\' AND "TargetID" = %d',
                Convert::raw2sql(ClassInfo::baseDataClass($item)),
                $item->ID
            );
            $complete = $includeComplete ? 'OR "WorkflowStatus" = \'Complete\' ' : '';
            return DataObject::get_one(
                WorkflowInstance::class,
                $filter . ' AND ("WorkflowStatus" = \'Active\' OR "WorkflowStatus"=\'Paused\' ' . $complete . ')'
            );
        }
    }