Cognitive Flow Optimization