code: static ExecutionStatus updatedFlowExecutionStatus(ExecutionStatus jobExecutionStatus,
        ExecutionStatus currentFlowExecutionStatus) {
  
      // if any job failed or flow has failed then return failed status
      if (currentFlowExecutionStatus == ExecutionStatus.FAILED ||
          jobExecutionStatus == ExecutionStatus.FAILED) {
        return ExecutionStatus.FAILED;
      }
  
      // if any job is cancelled or flow has failed then return failed status
      if (currentFlowExecutionStatus == ExecutionStatus.CANCELLED ||
          jobExecutionStatus == ExecutionStatus.CANCELLED) {
        return ExecutionStatus.CANCELLED;
      }
  
      if (currentFlowExecutionStatus == ExecutionStatus.RUNNING ||
          jobExecutionStatus == ExecutionStatus.RUNNING ||
          jobExecutionStatus == ExecutionStatus.ORCHESTRATED ||
          jobExecutionStatus == ExecutionStatus.COMPILED) {
        return ExecutionStatus.RUNNING;
      }
  
      return currentFlowExecutionStatus;
    }
docs: Determines the new flow status based on the current flow status and new job status
  @param jobExecutionStatus job status
  @param currentFlowExecutionStatus current flow status
  @return updated flow status