code: private void waitForInstances(String flowletId, int expectedInstances) throws InterruptedException, TimeoutException {
      int numRunningFlowlets = getNumberOfProvisionedInstances(flowletId);
      int secondsWaited = 0;
      while (numRunningFlowlets != expectedInstances) {
        LOG.debug("waiting for {} instances of {} before suspending flowlets", expectedInstances, flowletId);
        TimeUnit.SECONDS.sleep(SECONDS_PER_WAIT);
        secondsWaited += SECONDS_PER_WAIT;
        if (secondsWaited > MAX_WAIT_SECONDS) {
          String errmsg =
            String.format("waited %d seconds for instances of %s to reach expected count of %d, but %d are running",
                                        secondsWaited, flowletId, expectedInstances, numRunningFlowlets);
          LOG.error(errmsg);
          throw new TimeoutException(errmsg);
        }
        numRunningFlowlets = getNumberOfProvisionedInstances(flowletId);
      }
    }
docs: it cannot change instances without being in the suspended state.