The diversity of ecological interactions, trophic and non-trophic, is central to understand the assembly of communities. However, we have yet to integrate non-trophic to ecosystem-level processes such as recycling or habitat provisioning. Here, we study a simple ecosystem model where the dual role of detritus as both resource and habitat allows defining ecosystem engineering from non-trophic processes interacting with the cycling of matter at the ecosystem level. Our results show how habitat and resource limitation of consumer growth from detritus can affect ecosystem stability. We further predict that non-trophic processes can stabilize ecosystems via (\emph{i}) asynchrony between trophic and non-trophic interactions, (\emph{ii}) weak trophic interactions emerging from non-trophic feedbacks, and (\emph{iii}) coupling between non-trophic and recycling processes that control top-down \emph{vs.} bottom-up trophic regulation. Our results show ecosystem dynamics provides the relevant context to study the interplay between trophic and non-trophic processes.