In sensor network applications that do complex in-network processing, each node may perform its own task rather than all nodes executing the same aggregation function. To support the development of such applications, this paper introduces a network-level programming model that is based on the data flow in the application. When deploying the application, such a high-level model has to be mapped to nodes in the specific network topology. This paper presents an operator placement algorithm that tries to find an optimal mapping that minimizes data transmission throughout the network.