Preheat oven to 350°F (175°C).
In a large bowl, combine lentils, carrots, spinach, oats, walnuts, onions, garlic, flax egg, thyme, basil, salt, and pepper.
Mix well and transfer to a loaf pan lined with parchment paper.
In a small bowl, mix maple syrup, apricot preserves, and Dijon mustard.
Spread the glaze over the top of the loaf.
Bake for 45 minutes or until firm and golden brown.
Let cool slightly before slicing and serving.