We report the appearance of superconductivity in single-unit-cell Nd6Ni5O12, exhibiting a transition temperature similar to that of thicker films. In situ synchrotron x-ray scattering performed during growth of the parent phase, Nd6Ni5O16, shows that the necessary layer-by-layer deposition sequence does not follow the sequence of the formula unit but an alternate order due to the relative stability of the perovskite unit cell. We exploit this insight to grow ultrathin Nd6Ni5O16 heterostructures and conduct in situ studies of topotactic reduction, finding that formation of the square-planar phase occurs rapidly and is highly sensitive to reduction temperature, with small deviations from the optimum condition leading to inhomogeneity and the loss of superconductivity. The fluorite layer within the unit cell facilitates reduction by initially stabilizing the square-planar phase in the upper half of the unit cell. Our findings provide insight into growth of the Ruddlesden-Popper nickelates, highlighting the need for in situ studies of the metastable phases key to superconductivity.