Neural networks are typically defined by their synaptic connectivity, yet synaptic wiring diagrams often provide limited insight into network function. This is due partly to the importance of non-synaptic communication by neuromodulators, which can dynamically reconfigure circuit activity to alter its output. Here, we systematically map the patterns of neuromodulatory connectivity in a network that governs a developmentally critical behavioral sequence in Drosophila. This sequence, which mediates pupal ecdysis, is governed by the serial release of several key factors, which act both somatically as hormones and within the brain as neuromodulators. By identifying and characterizing the functions of the neuronal targets of these factors, we find that they define hierarchically organized layers of the network controlling the pupal ecdysis sequence: a modular input layer, an intermediate central pattern generating layer, and a motor output layer. Mapping neuromodulatory connections in this system thus defines the functional architecture of the network.