We study the behavior of Donaldson’s invariants of 4-manifolds based on the moduli space of anti-self-dual connections (instantons) in the perturbative field theory setting where the underlying source manifold has boundary. It is well-known that these invariants take values in the instanton Floer homology groups of the boundary 3-manifold. Gluing formulae for these constructions lead to a functorial topological field theory description according to a system of axioms developed by Atiyah, which can be also regarded in the setting of perturbative quantum field theory, as it was shown by Witten, using a version of supersymmetric Yang–Mills theory, known today as Donaldson–Witten theory. One can actually formulate an AKSZ model which recovers this theory for a certain gauge-fixing. We consider these constructions in a perturbative quantum gauge formalism for manifolds with boundary that is compatible with cutting and gluing, called the BV-BFV formalism, which was recently developed by Cattaneo, Mnev and Reshetikhin. We prove that this theory satisfies a modified Quantum Master Equation and extend the result to a global picture when perturbing around constant background fields. These methods are expected to extend to higher codimensions and thus might help getting a better understanding for fully extendable [Formula: see text]-dimensional field theories (in the sense of Baez–Dolan and Lurie) in the perturbative setting, especially when [Formula: see text]. Additionally, we relate these constructions to Nekrasov’s partition function by treating an equivariant version of Donaldson–Witten theory in the BV formalism. Moreover, we discuss the extension, as well as the relation, to higher gauge theory and enumerative geometry methods, such as Gromov–Witten and Donaldson–Thomas theory and recall their correspondence conjecture for general Calabi–Yau 3-folds. In particular, we discuss the corresponding (relative) partition functions, defined as the generating function for the given invariants, and gluing phenomena.