Revealing the spatial variation in phytoplankton and zooplankton communities, along with their responses to water flow, climate, and water quality from headwaters to downstream, is crucial for grasping their evolutionary dynamics and crafting ecological preservation strategies. Here, the spatial distribution, assembly processes, and stability changes of phytoplankton and zooplankton in the tributaries from headwaters to downstream reaches of the Danjiang River and the upper Hanjiang River (China) were analyzed using environmental DNA (eDNA) technology. Geographic factors accounted for over 60% of the variation in the distribution of phytoplankton and zooplankton, although environmental factors also played a significant role. From upstream to downstream, the proportion of phytoplankton Bacillariophyta decreased from 37.12% to 33.07% in March and from 27.68% to 25.36% in August. Euglenophyta decreased from 1.04% to 0.53% in March and 10.48% to 2.16% in August. The proportion of zooplankton Ciliophora increased from 67.17% to 85.04%, while Amoebozoa decreased by approximately 9.83% in August. Phytoplankton and zooplankton richness initially increased, then declined from upstream to downstream. The assembly of zooplankton and phytoplankton communities was mainly driven by deterministic processes, with values ranging from 0.2 to 0.5. Furthermore, the upstream community showed a stronger dominance of deterministic processes, while the mainstream community exhibited weaker determinism than the tributaries. In both March and August, zooplankton were more influenced by deterministic processes than phytoplankton. From upstream to downstream, the stability and complexity of phytoplankton and zooplankton networks decreased, significantly influenced by river width, flow velocity, agricultural land proportion, and nutrient concentration. Maintaining diverse phytoplankton was crucial for sustaining zooplankton diversity and ensuring network stability. Furthermore, the growth duration of phytoplankton and zooplankton was influenced by the spatial distribution of sampling points in the river, contributing to complex interactions with environmental factors. The complexity of these interactions necessitates careful consideration in future studies on spatial patterns in riverine plankton communities.