How to refactor complex dataflow

That’s a too broad question.

Usually, a good starting point in understanding a workflow is to look at the workflow diagram (the “Diagram” menu tab) and explore its external dependencies.