Ruddlesden-popper type Srn+1IrnO3n+1 compound is a major focus of condensed matter physics where the subtle balance between electron-electron correlation, spin-orbit interaction and crystal field effect brings a host of emergent phenomena. While it is understandable that a canted antiferromagnetic (AFM) insulating state with an easy-plane anisotropy is developed in Sr2IrO4 as the 2D limit of the series, it is intriguing that bilayer Sr3Ir2O7, with slightly higher effective dimensionality, stabilizes c-axis collinear antiferromagnetism. This also renders Sr3Ir2O7 as a unique playground to study exotic physics near a critical spin transition point. However, the epitaxial growth of the Sr3Ir2O7 is still a challenging task because of the narrow growth window. In our research, we have studied the thermodynamic process during synthesis of Sr3Ir2O7 thin films. We successfully expanded the synthesis window by mapping out the relation between the thin film sample crystal structure and gas pressure. Our work thus provides a more accessible avenue to stabilize metastable materials.