Not in the sense that we or other vertebrates do. You've kicked over a rock or clump of dirt and seen all the crawlers scurrying... did you ever think about what they were doing before you kicked their home apart? Invertebrates do not have brains but a collection of ganglion or ganglia, (plural) that respond to stimuli. It's known, that worms, etc., when not responding to stimuli, such as light, heat or cold, simply don't do anything. This periodof inactivity can be related to our sleep but it's not the same as turning out the lights and drifting off, only to return to conciousness sometime later. The worm will respond to stimuli and can be considered to be awake, but not in the same sense you experience...