code: public WorkflowDef getWorkflowDef(String name, @Nullable Integer version) {
          Preconditions.checkArgument(StringUtils.isNotBlank(name), "name cannot be blank");
  
          MetadataServicePb.GetWorkflowRequest.Builder request =
                  MetadataServicePb.GetWorkflowRequest.newBuilder()
                          .setName(name);
  
          if (version != null)
              request.setVersion(version);
  
          return protoMapper.fromProto(stub.getWorkflow(request.build()).getWorkflow());
      }
docs: Retrieve the workflow definition
  
  @param name    the name of the workflow
  @param version the version of the workflow def
  @return Workflow definition for the given workflow and version