By modifying the physical environment, ecosystem engineers can have inordinately large effects on surrounding communities and ecosystem functioning. However, the significance of engineering in ecosystems greatly depends on the physical characteristics of the engineered habitats. Mechanisms underlying such context‐dependent impact of engineers remain poorly understood even though they are crucial to establish general predictions concerning the contribution of engineers to ecosystem structure and function.The present study aimed to decrypt such mechanisms by determining how the environmental context modulates the effects of ecosystem engineers (bioturbators) on microorganisms in river sediments. To test the effects of environmental context on the role of bioturbators in sediments, we used mesocosms and recreated two sedimentary contexts in the laboratory by adding a layer of either fine or coarse sand at the top of a gravel‐sand matrix. For each sediment context, we examined how the sediment reworking activity of a bioturbating tubificid worm (Tubifex tubifex) generated changes in the physical (sediment structure and permeability) and abiotic environments (hydraulic discharge, water chemistry) of microorganisms. Microbial characteristics (abundances, activities) and leaf litter decomposition – a major microbially‐mediated ecological process – were measured to evaluate the impact of bioturbation on biotic compartment.Our results showed that the permeability, the availability of oxygen and the activities of microorganisms were reduced in sediments covered with fine sand, in comparison with sediments covered with coarse sand. Tubifex tubifex significantly increased permeability (by about six‐fold), restored aerobic conditions and ultimately stimulated microbial communities (resulting in a 30% increase in leaf litter breakdown rate) in sediments covered with fine sand. In contrast T. tubifex had low effects in sediments topped by coarse sand, where O2 was already available for hyporheic microorganisms. Our study supports the idea that context dependency mainly modulates the effects of engineering by controlling the ability of engineers to create changes on abiotic (O2 in the present study) factors that are limiting for surrounding communities.