We study how confinement transforms the chaotic dynamics of bulk microtubule-based active nematics into regular spatiotemporal patterns. For weak confinements, multiple continuously nucleating and annihilating topological defects self-organize into persistent circular flows of either handedness. Increasing confinement strength leads to the emergence of distinct dynamics, in which the slow periodic nucleation of topological defects at the boundary is superimposed onto a fast procession of a pair of defects. A defect pair migrates towards the confinement core over multiple rotation cycles, while the associated nematic director field evolves from a distinct double spiral towards a nearly circularly symmetric configuration. The collapse of the defect orbits is punctuated by another boundary-localized nucleation event, that sets up long-term doubly-periodic dynamics.Comparing experimental data to a theoretical model of an active nematic, reveals that theory captures the fast procession of a pair of + 1 2 defects, but not the slow spiral transformation nor the periodic nucleation of defect pairs. Theory also fails to predict the emergence of circular flows in the weak confinement regime. The developed confinement methods are generalized to more complex geometries, providing a robust microfluidic platform for rationally engineering two-dimensional autonomous flows. arXiv:1810.09032v2 [cond-mat.soft]