code: @VisibleForTesting
      Workflow populateWorkflowAndTaskData(Workflow workflow) {
          Workflow workflowInstance = workflow.copy();
  
          if (StringUtils.isNotBlank(workflow.getExternalInputPayloadStoragePath())) {
              // download the workflow input from external storage here and plug it into the workflow
              Map<String, Object> workflowInputParams = externalPayloadStorageUtils.downloadPayload(workflow.getExternalInputPayloadStoragePath());
              Monitors.recordExternalPayloadStorageUsage(workflow.getWorkflowName(), ExternalPayloadStorage.Operation.READ.toString(), ExternalPayloadStorage.PayloadType.WORKFLOW_INPUT.toString());
              workflowInstance.setInput(workflowInputParams);
              workflowInstance.setExternalInputPayloadStoragePath(null);
          }
  
          workflowInstance.getTasks().stream()
                  .filter(task -> StringUtils.isNotBlank(task.getExternalInputPayloadStoragePath()) || StringUtils.isNotBlank(task.getExternalOutputPayloadStoragePath()))
                  .forEach(task -> {
                      if (StringUtils.isNotBlank(task.getExternalOutputPayloadStoragePath())) {
                          task.setOutputData(externalPayloadStorageUtils.downloadPayload(task.getExternalOutputPayloadStoragePath()));
                          Monitors.recordExternalPayloadStorageUsage(task.getTaskDefName(), ExternalPayloadStorage.Operation.READ.toString(), ExternalPayloadStorage.PayloadType.TASK_OUTPUT.toString());
                          task.setExternalOutputPayloadStoragePath(null);
                      }
                      if (StringUtils.isNotBlank(task.getExternalInputPayloadStoragePath())) {
                          task.setInputData(externalPayloadStorageUtils.downloadPayload(task.getExternalInputPayloadStoragePath()));
                          Monitors.recordExternalPayloadStorageUsage(task.getTaskDefName(), ExternalPayloadStorage.Operation.READ.toString(), ExternalPayloadStorage.PayloadType.TASK_INPUT.toString());
                          task.setExternalInputPayloadStoragePath(null);
                      }
                  });
          return workflowInstance;
      }
docs: Populates the workflow input data and the tasks input/output data if stored in external payload storage.
  This method creates a deep copy of the workflow instance where the payloads will be stored after downloading from external payload storage.
  
  @param workflow the workflow for which the data needs to be populated
  @return a copy of the workflow with the payload data populated