Quantitative methods to pinpoint the origin of atmospheric temperature anomalies (T’) associated with heatwaves are pivotal for the construction of physically plausible synoptic storylines of heatwave formation and their evaluation in models. Here, we combine a Lagrangian T’ decomposition with concepts from moisture tracking techniques to identify where and when the principal physical processes generate T’ and to attribute these sources to synoptic weather systems. Applying this framework to near-surface and free-tropospheric T’ associated with the record-shattering 2021 heatwave in the Pacific Northwest shows that ascending, diabatic air streams in North Pacific cyclones contribute more than 50% of free-tropospheric T’, whereas near-surface T’ is mainly produced by local subsidence and diabatic heating with only marginal upstream contributions. Since free-tropospheric T’ facilitates near-surface accumulation of locally produced T’ by rendering the atmosphere stable to moist convection, our findings corroborate the notion of top-down induced heatwave formation fuelled by upstream diabatic processes.