Wastewater effluent introduces substantial dissolved organic nitrogen into rivers, thereby increasing the risk of carcinogenic N-nitrosodimethylamine (NDMA) formation from its precursors. However, the microbial metabolic mechanisms governing dynamics of these precursors along receiving rivers remain unclear. Here, through a 21-day time-series incubation of sediments from upstream, outfall, and downstream areas of a representative wastewater treatment plant, combined with multi-omics analyses i.e., 16S rRNA gene sequencing, metagenomics, and metabolomics, the transformation of precursors and microbially mediated nitrogen metabolism were elucidated. A biphasic pattern of NDMA precursors measured as formation potential (FP) was observed during incubation, characterized by a rapid formation from days 0 to 3 followed by a remarkable degradation until day 7 and subsequent stabilization. Nitrate peaked paralleling NDMA FP, with nitrite accumulation following the onset of precursors degradation. Multi-omics analysis revealed that this turnover was driven by strong functional coupling between key nitrogen-cycling taxa and specific metabolites, particularly short-chain peptides. Community structure in the early phase was dominated by r‑strategists e.g., Bacillota, which promoted organic nitrogen degradation and nitrification, resulting in the accumulation of NDMA precursors. As anoxia developed, the community shifted toward K‑strategists such as Pseudomonadota and Chloroflexota, which likely degraded precursors through co-metabolism and consumption of ammonia source. Metabolomics revealed the conversion of precursors into short-chain peptides and amino acid analogues. Notably, effluent exposure established a functionally specialized legacy effect in downstream sediments, stabilizing into a microbial metabolic hotspot with a peak NDMA FP of 1285 ng/L, 158% and 80.7% higher than those in the upstream and outfall area, respectively. This study establishes a mechanistic framework for evaluating the transformation and risk of NDMA precursors in river systems, with direct implications for monitoring strategies and designing of the wastewater outfall location.