As sensor networks mature, there will be an increasing need for re-usable, dynamically taskable software systems that support multiple concurrent applications. In this paper, we consider the problem of energy management in such systems, taking Tenet as a case study. Our work considers energy management under three new constraints: dynamic multi-hop routing and tasking, multiple concurrent applications, and reliable end-toend data delivery. We present AEM, an energy management system that satisfies these constraints. AEM statically analyzes and infers the traffic profile for the application and accordingly tunes the duty-cycling protocol to provide the best trade-off in latency and data delivery performance. Furthermore, unlike other duty-cycling protocols with pre-computed or fixed transmission and reception time slots, AEM uses elastic schedules that allows it to adapt to dynamics while enabling bounded latency of event detection. Our experiments show that AEM achieves 1-3% duty-...