Wrap runtasks in an atomic transaction