Energy-efficient approaches to propylene/propane separation such as molecular sieving are of considerable importance for the petrochemical industry. The metal organic framework NbOFFIVE-1-Ni adsorbs propylene but not propane at room temperature and atmospheric pressure, whereas the isostructural SIFSIX-3-Ni does not exclude propane under the same conditions. The static dimensions of the pore openings of both materials are too small to admit either guest, signalling the importance of host dynamics for guest entrance to and transport through the channels. We use ab initio calculations together with crystallographic and adsorption data to show that the dynamics of the two framework-forming units, polyatomic anions and pyrazines, govern both diffusion and separation. The guest diffusion occurs by opening of the flexible window formed by four pyrazines. In NbOFFIVE-1-Ni, (NbOF5)2- anion reorientation locates propane away from the window, which enhances propylene/propane separation.