Devices that rely on the manipulation of excitons-bound pairs of electrons and holes-hold great promise for realizing efficient interconnects between optical data transmission and electrical processing systems. Although exciton-based transistor actions have been demonstrated successfully in bulk semiconductor-based coupled quantum wells1-3, the low temperature required for their operation limits their practical application. The recent emergence of two-dimensional semiconductors with large exciton binding energies4,5 may lead to excitonic devices and circuits that operate at room temperature. Whereas individual two-dimensional materials have short exciton diffusion lengths, the spatial separation of electrons and holes in different layers in heterostructures could help to overcome this limitation and enable room-temperature operation of mesoscale devices6-8. Here we report excitonic devices made of MoS2-WSe2 van der Waals heterostructures encapsulated in hexagonal boron nitride that demonstrate electrically controlled transistor actions at room temperature. The long-lived nature of the interlayer excitons in our device results in them diffusing over a distance of five micrometres. Within our device, we further demonstrate the ability to manipulate exciton dynamics by creating electrically reconfigurable confining and repulsive potentials for the exciton flux. Our results make a strong case for integrating two-dimensional materials in future excitonic devices to enable operation at room temperature.