Dear student,
Decomposition reactions involve the breaking of bonds that require energy. Due to this decomposition reactions are generally endothermic in nature.
The decomposition of vegetables into compost is considered an exothermic reaction because this decomposition reaction is facilitated by microbes and those microbes need some energy to break the bonds of vegetables, when bonds are broken energy is released, hence considered to be an exothermic reaction.
Regards