Major surgery and critical illness produce a potentially life-threatening systemic inflammatory response. The hypothalamic–pituitary–adrenal (HPA) axis is one of the key physiological systems that counterbalances this systemic inflammation through changes in adrenocorticotrophic hormone (ACTH) and cortisol. These hormones normally exhibit highly correlated ultradian pulsatility with an amplitude modulated by circadian processes. However, these dynamics are disrupted by major surgery and critical illness. In this work, we characterize the inflammatory, ACTH and cortisol responses of patients undergoing cardiac surgery and show that the HPA axis response can be classified into one of three phenotypes: single-pulse, two-pulse and multiple-pulse dynamics. We develop a mathematical model of cortisol secretion and metabolism that predicts the physiological mechanisms responsible for these different phenotypes. We show that the effects of inflammatory mediators are important only in the single-pulse pattern in which normal pulsatility is lost—suggesting that this phenotype could be indicative of the greatest inflammatory response. Investigating whether and how these phenotypes are correlated with clinical outcomes will be critical to patient prognosis and designing interventions to improve recovery.