public function getNamedTemplate($name)
    {
        if ($importedTemplate = singleton(WorkflowDefinitionImporter::class)->getImportedWorkflows($name)) {
            return $importedTemplate;
        }

        if (!is_array($this->templates)) {
            return;
        }
        foreach ($this->templates as $template) {
            if ($template->getName() == $name) {
                return $template;
            }
        }
    }