code: public static boolean isFinished(final ExecutableFlow flow) {
      switch (flow.getStatus()) {
        case SUCCEEDED:
        case FAILED:
        case KILLED:
          return true;
        default:
          return false;
      }
    }
docs: Check if the flow status is finished.
  
  @param flow the executable flow
  @return the boolean