Let G be a finite group and χ:G→C a class function. Let H=(V,E) be a directed graph with for each vertex a cyclic order of the edges incident to it. The cyclic orders give a collection F of faces of H. Define the partition function 0truePχ(H):=∑κ:E→G∏v∈Vχ(κfalse(δ(v)false)), where κ(δ(v)) denotes the product of the κ‐values of the edges incident with v (in cyclic order), where the inverse is taken for edges leaving v. Write 0trueχ=∑λmλχλ, where the sum runs over irreducible representations λ of G with character χλ and with mλ∈C for every λ. When H is connected, it is proved that 0truePχ(H)=false|Gfalse|false|Efalse|∑λχλfalse(1false)false|Ffalse|−false|Efalse|mλfalse|Vfalse|, where 1 is the identity element of G. Among the corollaries, a formula for the number of nowhere‐identity G‐flows on H is derived, generalizing a result of Tutte. We show that these flows correspond bijectively to certain proper G‐colorings of a covering graph of the dual graph of H. This correspondence generalizes coloring‐flow duality for planar graphs.