private void populateWorkflowTaskWithDefinition(WorkflowTask workflowTask) {
        Utils.checkNotNull(workflowTask, "WorkflowTask cannot be null");
        if (shouldPopulateTaskDefinition(workflowTask)) {
            workflowTask.setTaskDefinition(metadataDAO.getTaskDef(workflowTask.getName()));
            if (workflowTask.getTaskDefinition() == null
                    && workflowTask.getType().equals(TaskType.SIMPLE.name())) {
                // ad-hoc task def
                workflowTask.setTaskDefinition(new TaskDef(workflowTask.getName()));
            }
        }
        if (workflowTask.getType().equals(TaskType.SUB_WORKFLOW.name())) {
            populateVersionForSubWorkflow(workflowTask);
        }
    }
Populates metadata definitions within workflow objects. Benefits of loading and populating
metadata definitions upfront could be:

<ul>
  <li>Immutable definitions within a workflow execution with the added benefit of guaranteeing
      consistency at runtime.
  <li>Stress is reduced on the storage layer
</ul>
core/src/main/java/com/netflix/conductor/core/metadata/MetadataMapperService.java