Using query setting to automatically run

I am never able to successfully implement a query the runs on its own in a stable fashion. It always seems I have to run around trying to find creative ways to block it from running inappropriately. For instance. I had a retool database updating using the changeSetArray. The query would also run an on success event to reset the tables changset. The query would run, then it would self trigger again after resetting the table changeset. So, I then made sure the query was disabled if the changeset is empty. That didn't fix it and it would still run twice. How are other people succeeding in having queries run automatically?