This paper extends a recently suggested approach for the steady-state process optimization with guaranteed robust stability and flexibility under parametric uncertainty. The approach is based on measuring the distance of a candidate point of operation to so-called critical manifolds. Critical manifolds locally separate regions of the space of the process and controller design parameters with desired process traits from those regions with undesired traits. Pairs of desired and undesired traits may, for example, be feasibility and infeasibility of operation, stability and instability, or more generally, desired dynamical behavior and undesired dynamical behavior. While in previous applications knowledge on the existence and location of critical manifolds were assumed to be available before the optimization was attempted, the present paper presents an algorithm in which critical manifolds are automatically detected as the optimization proceeds. This algorithm, which is the conceptual contribution of the paper, allows the application of the critical manifold-based approach to processes for which no a priori information on the existence and location of critical manifolds exists. As a proof of concept the algorithm is applied to the reaction section of the HDA process. An analysis of the critical manifolds of this process model is not available. Since 12 uncertain parameters exists, analyzing the critical manifolds would be tedious. While an analysis of the 12 uncertain parameters is not practical, the critical manifold-based optimization approach can be applied to models with this number of parameters and beyond.