code: public boolean isExistingPipeline(String pipelineName) throws IOException {
          logger.debug("is existing pipeline [{}]", pipelineName);
  
          try {
              Response restResponse = lowLevelClient.performRequest("GET", "/_ingest/pipeline/" + pipelineName);
              logger.trace("get pipeline metadata response: {}", asMap(restResponse));
              return true;
          } catch (ResponseException e) {
              if (e.getResponse().getStatusLine().getStatusCode() == 404) {
                  logger.debug("pipeline [{}] does not exist", pipelineName);
                  return false;
              }
              throw e;
          }
      }
docs: Check if a pipeline exists
  @param pipelineName pipeline name
  @return true if the pipeline exists, false otherwise
  @throws IOException In case of error