In the 1980s Pierre Julg and Alain Valette, and also Tadeusz Pytlik and Ryszard Szwarc, constructed and studied a certain Fredholm operator associated to a simplicial tree. The operator can be defined in at least two ways: from a combinatorial flow on the tree, similar to the flows in Formans discrete Morse theory, or from the theory of unitary operator-valued coccyges. There are applications of the theory surrounding the operator to C*-algebra K-theory, to the theory of completely bounded representations of groups that act on trees, and to the Selberg principle in the representation theory of p-adic groups. The main aim of this paper is to extend the constructions of Julg and Valette, and Pytlik and Szwarc, to CAT(0) cubical spaces. A secondary aim is to illustrate the utility of the extended construction by developing an application to operator K-theory and giving a new proof of K-amenability for groups that act properly on bounded-geometry CAT(0)-cubical spaces.