Dehydration of serine/threonine residues necessitates the activity of a dehydratase enzyme (domain) during the biosynthesis of ribosomally synthesized and post-translationally modified peptide (RiPP). Recently, it was reported that the dehydration process in thioviridamide relies on a distinct dehydratase complex which showcases the activities of a phosphotransferase TvaC for serine/threonine phosphorylation and a lyase TvaD for subsequent phosphate elimination. Herein, we report that the dehydration process of lantibiotic cacaoidin involves a similar dehydratase complex, CaoK/CaoY. Remarkably, this dehydratase complex exhibits flexible enzymatic activity and tolerates significant variations in its substrate peptide sequence. By binding with the leader peptide (LP) sequence of precursor peptide CaoA, the dehydration reactions proceed directionality from the C-terminus of the core peptide (CP) to its N-terminus, and C-terminally truncated variants of CP are acceptable. We show that fusing CaoK to CaoY in a 1:1 molar ratio enables the resulting enzyme CaoYK to exert enhanced dehydration activity. CaoK binds with the LP to improve its own solubility and to ensure the phosphate transfer activity, while CaoY functions independently of the LP. This work advances our understanding of the dehydration process of cacaoidin, and provides valuable enzymes and methods for the studies of the rapidly emerging RiPPs.