Flow generating algorithm

It generates run flow based on the dependencies between run steps.