Global variable undefined in subflow?

Perhaps you are trying to access the parent context of the subflow ? If this is the case you should test prepending $parent to the name of the scope variable.