Pitaya, a desert plant, has an underexplored flowering mechanism due to a lack of functional validation assays. This study reveals that the transition from vegetative to generative growth in pitaya is regulated by significant metabolic shift, underscoring the importance of understanding and address the challenging issue pitaya's phase change. Lateral buds from 6-years-old 'Guanhuahong' pitaya (Hylocereus monacanthus) plants were collected on April 8th, 18th, and 28th 2023, representing early, middle, and late stages of phase transition, respectively. Results showed diminished nitrogen levels concurrent with increased carbon levels and carbon-to-nitrogen (C/N) ratios during pitaya phase transition. Transcriptomic analysis identified batches of differentially expressed genes (DEGs) involved in downregulating nitrogen metabolism and upregulating carbon metabolism. These batches of genes play a central role in the metabolic shifts that predominantly regulate the transition to the generative phase in pitaya. This study unveils the intricate regulatory network involving 6 sugar synthesis and transport, 11 photoperiod (e.g., PHY, CRY, PIF) and 6 vernalization (e.g., VIN3) pathways, alongside 11 structural flowering genes (FCA, FLK, LFY, AGL) out of a vast array of potential candidates in pitaya phase change. These findings provide insights into the metabolic pathways involved in pitaya's phase transition, offering a theoretical framework for managing flowering, guiding breeding strategies to optimize flowering timing and improve crop yields under varied nitrogen conditions.