A recent model of continental arc magmatism states that subducted sediments mix physically with the oceanic slab basalts in the subduction channel and produce diapirs that ascend through the mantle wedge, undergo melting and relaminate to the base of the continental crust. From here, melt or magma batches ascend through the crust, producing the Cordilleran batholiths and associated volcanism ranging in composition from 0 to 25 wt% maficity (FeO t + MgO) and 44–79 wt% SiO 2 , with a gap around 11.5 wt% maficity and 57–60 wt% SiO 2 . This model has been predicted by thermomechanical numerical studies and later supported by phase equilibrium experiments; however, thermodynamic modelling to verify whether the composition of the Cordilleran batholiths is reproduced by this model has not yet been carried out to complement the experimental approach. In this article, the evolution of the mélange along the subduction path and during the ascent of the diapirs is investigated, with focus on the conditions of generation of the diapirs, the composition and proportion of melt at the P-T conditions of relamination of the diapirs, the relationship between the basalt:sediment proportion (the composition) of the diapir to this melt composition and proportion and whether the composition of the melts match the Cordilleran batholiths. The key point to test is the process or processes that produce the compositional variability observed in these granitoids. Our findings indicate that (1) parental melts and/or magmas range in maficity from ∼1 to ∼11.5 wt%, with the compositional gap of the Cordilleran trend representing the most mafic composition possible of the parent, (2) the diapirs are restricted to having 50–60% of sediment component: diapirs with lower sediment contents may be too dense to detach from the slab and mélanges with higher sediment contents may be too less dense to be subducted to the depth of formation of diapirs, (3) melts at 1100 °C and 1.5 GPa from these diapirs have the bulk granodioritic composition of the batholiths, (4) restite unmixing occurs when magma batches segregate from the relaminated diapirs, (5) the lower the temperature of the region of the diapir from which the batch segregates, the higher the restite content, (6) the temperature, by controlling the restite content, is the ultimate factor controlling the compositional trends of Cordilleran batholiths, and (7) fractional crystallization or cotectic evolution is still needed to account for the full compositional range of these batholiths, from the parental 1–11.5 wt% to the observed 0–25 wt% in maficity. • Cordilleran granitoids can be formed by melting of subducted basalt and sediment. • Parental magmas of Cordilleran granitoids derive from diapirs relaminated to the crust. • The main process controlling the composition of granitoids is restite entrainment. • The higher the temperature of the diapir, the lower the amount of restites entrained. • Composition of diapirs is restricted to having 50–60% sediment component.