code: @Procedure(mode = Mode.WRITE)
      @Description("apoc.periodic.iterate('statement returning items', 'statement per item', {batchSize:1000,iterateList:true,parallel:false,params:{},concurrency:50,retries:0}) YIELD batches, total - run the second statement for each item returned by the first statement. Returns number of batches and total processed rows")
      public Stream<BatchAndTotalResult> iterate(
              @Name("cypherIterate") String cypherIterate,
              @Name("cypherAction") String cypherAction,
              @Name("config") Map<String,Object> config) {
  
          long batchSize = Util.toLong(config.getOrDefault("batchSize", 10000));
          int concurrency = Util.toInteger(config.getOrDefault("concurrency", 50));
          boolean parallel = Util.toBoolean(config.getOrDefault("parallel", false));
          boolean iterateList = Util.toBoolean(config.getOrDefault("iterateList", true));
          long retries = Util.toLong(config.getOrDefault("retries", 0)); // todo sleep/delay or push to end of batch to try again or immediate ?
          Map<String,Object> params = (Map)config.getOrDefault("params", Collections.emptyMap());
          int failedParams = Util.toInteger(config.getOrDefault("failedParams", -1));
          try (Result result = db.execute(slottedRuntime(cypherIterate),params)) {
              Pair<String,Boolean> prepared = prepareInnerStatement(cypherAction, iterateList, result.columns(), "_batch");
              String innerStatement = prepared.first();
              iterateList=prepared.other();
              log.info("starting batching from `%s` operation using iteration `%s` in separate thread", cypherIterate,cypherAction);
              return iterateAndExecuteBatchedInSeparateThread((int)batchSize, parallel, iterateList, retries, result, (p) -> db.execute(innerStatement, merge(params, p)).close(), concurrency, failedParams);
          }
      }
docs: invoke cypherAction in batched transactions being feeded from cypherIteration running in main thread
  @param cypherIterate
  @param cypherAction