High fluxes available at modern neutron and synchrotron sources have opened up a wide variety of in situ and operando studies of real processes using scattering techniques. This has allowed the user community to follow chemistry in the beam, which often requires high temperatures, gas flow, etc. In this paper, we describe an integrated gas handling system for the general-purpose powder diffraction beamline Powgen at the Spallation Neutron Source. The Automated Gas Environment System (AGES) allows control of both gas flow and temperature (room temperature to 850 °C), while measuring the partial pressure of oxygen and following the effluent gas by mass spectrometry, concurrent with neutron powder diffraction, in order to follow the structural evolution of materials under these conditions. The versatility of AGES is illustrated by two examples of experiments conducted with the system. In solid oxide fuel cell electrode materials, oxygen transport pathways in double perovskites PrBaCo2O5+δ and NdBaCo2O5+δ were elucidated by neutron diffraction measurements under atmosphere with oxygen partial pressures (pO2) of 10−1 to 10−4 (achieved using mixtures of nitrogen and oxygen) and temperatures from 575 to 850 °C. In another example, the potential oxygen storage material La1−xSrxFeO3 was measured under alternating flows of 15% CH4 in N2 and air (20% O2 in N2) at temperatures from 135 to 835 °C. From the oxygen stoichiometry, the optimal composition for oxygen storage was determined.