Earthworms are decomposers and cannot use the energy in inorganic substances, so they are heterotrophs.
And some bacteria. Some of them, like plants, use solar energy to provide energy for themselves, while others use some inorganic gases to maintain themselves. They don't need to absorb nutrients from organic matter, so they are all autotrophs.
Insectivorous plants are an exception. ....
I hope my answer can help you!