Astrophysical accretion flows are associated with energetic emission of radiation and outflows (winds and jets). Extensive observations of these two processes in X-ray binary outbursts are available. A convincing understanding of their dynamics remains, however, elusive. The main agent that controls the dynamics is believed to be a large scale magnetic field that threads the system. We propose that during the quiescent state, the field is held in place by a delicate balance between inward advection and outward diffusion through the accreting matter. We also propose that the source of the field is a growing toroidal electric current generated by the aberrated radiation pressure on the innermost plasma electrons in orbit around the central black hole. This is the astrophysical mechanism of the Cosmic Battery. When the return magnetic field outside the toroidal electric current diffuses through the surrounding disk, the disk magnetic field and its associated accretion rate gradually increase, thus leading the system to an outburst. After the central accretion flow approaches equipartition with radiation, it is disrupted, and the Cosmic Battery ceases to operate. The outward field diffusion is then reversed, magnetic flux reconnects with the flux accumulated around the central black hole and disappears. The magnetic field and the associated accretion rate slowly decrease, and the system is gradualy driven back to quiescence. We conclude that the action (or inaction) of the Cosmic Battery may be the missing key that will allow us to understand the long-term evolution of astrophysical accretion-ejection flows.