a, The photochemical reaction of solutes supplied by a liquid-flowing system is triggered by a femtosecond optical laser pulse. Subsequently, a time-delayed X-ray pulse synchronized with the laser pulse probes the structural dynamics of the reaction. The scattering pattern is detected by a fast two-dimensional charge-coupled device detector as shown at the bottom. We measure time-resolved scattering patterns while varying the time delay between the laser and X-ray pulses. b, By integrating the two-dimensional scattering pattern azimuthally, subtracting solvent contributions, performing a Fourier transform and compensating for the depletion of the initial solute contribution due to photochemical reaction, we obtain one-dimensional RDFs in real space as shown in the plot at the top left. These display the interatomic distances of transient species and products. In this way, Au-Au bond lengths of the [Au(CN)2-]3 complex can be identified with sub-ångström accuracy, and the time-dependent structural changes of the metal complex can be determined in real time.