Our study unveils a pioneering methodology that effectively distributes Pd species within a zeolitic imidazolate framework-8 (ZIF-8). We demonstrate that Pd can be encapsulated within ZIF-8 as atomically dispersed Pd species that function as an excited-state transition metal catalyst for promoting carbon–carbon (C−C) cross-couplings at room temperature using visible light as the driving force. Furthermore, the same material can be reduced at 250 °C, forming Pd metal nanoparticles encapsulated in ZIF-8. This catalyst shows high rates and selectivity for carbon dioxide hydrogenation to methanol under industrially relevant conditions (250 °C, 50 bar): 7.46 molmethanol molmetal−1 h−1 and >99 %. Our results demonstrate the correlations of the catalyst structure with the performances at experimental and theoretical levels.