Adapting Lindstrom's well-known construction, we consider a wide class of functions which are generated by flows in a planar acyclic directed graph whose vertices (or edges) take weights in an arbitrary commutative semiring. We give a combinatorial description for the set of "universal" quadratic relations valid for such functions. Their specializations to particular semirings involve plenty of known quadratic relations for minors of matrices (e.g., Plucker relations) and the tropical counterparts of such relations. Also some applications and related topics are discussed.