Any process in which factors in the hemolymph (the invertebrate equivalent of vertebrate blood and lymph) precipitate into insoluble clots in order to prevent loss of body fluid, and at the same time prevent the movement of microbes. Hemolymph coagulation is also part of the invertebrate humoral immune response.