Fast outflows and their interaction with slow shells (generally known as the fossil circumstellar envelope of asymptotic giant branch stars) play an important role in the structure and kinematics of protoplanetary and planetary nebulae (pPNe, PNe). To properly study their effects within these objects, we also need to observe the intermediate-temperature gas, which is only detectable in the far-infrared (FIR) and submillimetre (submm) transitions. We study the physical conditions of the outflows presented in a number of pPNe and PNe, with a focus on their temperature and excitation states. We carried out Herschel/HIFI observations in the submm lines of 12CO in nine pPNe and nine PNe and complemented them with low-J CO spectra obtained with the IRAM 30m telescope and taken from the literature. The spectral resolution of HIFI allows us to identify and measure the different nebular components in the line profiles. The comparison with large velocity gradient (LVG) model predictions was used to estimate the physical conditions of the warm gas in the nebulae, such as excitation conditions, temperature, and density. We found high kinetic temperatures for the fast winds of pPNe, typically reaching between 75 K and 200 K. In contrast, the high-velocity gas in the sampled PNe is colder, with characteristic temperatures between 25 K and 75 K, and it is found in a lower excitation state. We interpret this correlation of the kinetic temperature and excitation state of fast outflows with the amount of time elapsed since their acceleration (probably driven by shocks) as a consequence of the cooling that occurred during the pPN phase.