public WorkflowModel populateWorkflowWithDefinitions(WorkflowModel workflow) {
        Utils.checkNotNull(workflow, "workflow cannot be null");
        WorkflowDef workflowDefinition =
                Optional.ofNullable(workflow.getWorkflowDefinition())
                        .orElseGet(
                                () -> {
                                    WorkflowDef wd =
                                            lookupForWorkflowDefinition(
                                                    workflow.getWorkflowName(),
                                                    workflow.getWorkflowVersion());
                                    workflow.setWorkflowDefinition(wd);
                                    return wd;
                                });

        workflowDefinition.collectTasks().forEach(this::populateWorkflowTaskWithDefinition);
        checkNotEmptyDefinitions(workflowDefinition);

        return workflow;
    }
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