The four main decomposers in an ecosystem are bacteria, fungi, worms (or other macroorganisms), and detritivores.