Reperfusion after myocardial ischemia would aggravate myocardial structural and functional damage, known as myocardial ischemia-reperfusion (MI/R) injury. Cinnamamide derivatives have been reported to exert cardioprotective effects, and we have previously reported that compound 7 played a role in cardioprotection against MI/R via anti-inflammatory effect. However, exact mechanism underlying such beneficial action of compound 7 is still unclear. The protective effect of compound 7 was determined in H9c2 cells under H2O2 stimulation with or without nigerin (NLRP3 activator). Electrocardiogram, echocardiography, myocardial infarction size, histopathology and serum biochemical assay were performed in MI/R rats. Metabolomics in vivo and mRNA or protein levels of NLRP3, ASC, cleaved caspase-1 and its downstream IL-18 and IL-1β were detected both in vitro and in vivo. Compound 7 significantly ameliorate H2O2-induced cardiomyocyte damage, which was supported by in vivo data determined by improved left ventricular systolic function and histopathological changes, reduced myocardial infarction area and cellular apoptosis in heart tissue. Cardiac differential metabolites demonstrated that compound 7 indeed altered the cardiac reprogramming of inflammation-related metabolites, which was evidenced by down-regulated cardiac inflammation by compound 7. Additionally, compound 7 alleviated myocardial injury by inhibiting the NLRP3 pathway rather than other members of the inflammasome both in vitro and in vivo, which was further evidenced by CETSA assay. Whereas, nigerin blocked the inhibitory activity of compound 7 against NLRP3. Cinnamamide derivative compound 7 ameliorated MI/R injury by inhibiting inflammation via NLRP3.