do we really need this? This is what was causing the problem. Why not just add a hook to the job to process the Flow after it was run, and call .getStats on the flow.  Then we can remove all these global variables.