You can use Injector::inst()->createWithArgs('WorkflowTemplate', $struct['constructor']);