An important feature of animal behavior is the ability to switch rapidly between activity states, however, how the brain regulates these spontaneous transitions based on the animal's perceived environment is not well understood. Here we show a C. elegans sleep-like state on a scalable platform that enables simultaneous control of multiple environmental factors including temperature, mechanical stress, and food availability. This brief quiescent state, which we refer to as microfluidic-induced sleep, occurs spontaneously in microfluidic chambers, which allows us to track animal movement and perform whole-brain imaging. With these capabilities, we establish that microfluidic-induced sleep meets the behavioral requirements of C. elegans sleep and depends on multiple factors, such as satiety and temperature. Additionally, we show that C. elegans sleep can be induced through mechanosensory pathways. Together, these results establish a model system for studying how animals process multiple sensory pathways to regulate behavioral states.