Apps Script: This script has too many triggers
Last verified
This script has too many triggers. Triggers must be deleted from the script before more can be added.What it means
Google's quotas page limits triggers to 20 per user per script. When code calls ScriptApp.newTrigger(...).create() and that user already has 20 triggers on the project, Apps Script throws this error.
The limit is per user, so another collaborator's triggers on the same project do not count against yours, and you cannot see or delete theirs from your Triggers page.
This almost always means code is creating triggers repeatedly, for example on every run or every form submission, without deleting old ones.
What it looks like
function ensureTrigger(handler) {
const exists = ScriptApp.getProjectTriggers()
.some(t => t.getHandlerFunction() === handler);
if (!exists) {
ScriptApp.newTrigger(handler).timeBased().everyHours(1).create();
}
}Why it happens
- A setup function that creates a trigger every time it runs instead of checking whether one exists.
- A chained-execution pattern that creates a new one-off time trigger each run and never deletes the previous one.
- An add-on that creates triggers per document or per user action.
- Triggers left over from old versions of the script.
How to fix it
- Open the Triggers page for the project and delete triggers you do not need.
- Or run a one-time cleanup that loops over ScriptApp.getProjectTriggers() and calls ScriptApp.deleteTrigger on each, then recreate only what is needed.
- Change setup code to check getProjectTriggers() for an existing trigger on the same handler before creating a new one.
- In chained jobs, delete the trigger that started the current run at the beginning of that run.
- If you need many schedules, use one trigger that dispatches to several tasks.
How to stop it recurring
Make every trigger-creating function idempotent, and give one-off triggers a cleanup step. A single dispatcher trigger is easier to reason about than many small ones, and it keeps you well away from the 20-trigger limit.
Official documentation: developers.google.com/apps-script/guides/services/quotas. See all Apps Script error messages or the Apps Script limits and quotas.
Related errors
Definitions
- Google Apps ScriptGoogle Apps Script is Google's cloud-hosted JavaScript platform for automating Google Workspace: Sheets, Gmail
- Error HandlingError handling is the practice of anticipating, detecting, and responding to errors in software execution, inc
- Rate LimitingRate limiting is a technique that controls the number of requests a client can make to a server within a given
- OAuth 2.0OAuth 2.0 is the IETF authorization standard (RFC 6749) that lets an app access your account in another servic
Quick answers
What does "This script has too many triggers" mean in Apps Script?
Google's quotas page limits triggers to 20 per user per script. When code calls ScriptApp.newTrigger(...).create() and that user already has 20 triggers on the project, Apps Script throws this error. The limit is per user, so another collaborator's triggers on the same project do not count against yours, and you cannot see or delete theirs from your Triggers page.
How do I fix "This script has too many triggers"?
1. Open the Triggers page for the project and delete triggers you do not need. 2. Or run a one-time cleanup that loops over ScriptApp.getProjectTriggers() and calls ScriptApp.deleteTrigger on each, then recreate only what is needed. 3. Change setup code to check getProjectTriggers() for an existing trigger on the same handler before creating a new one. 4. In chained jobs, delete the trigger that started the current run at the beginning of that run. 5. If you need many schedules, use one trigger that dispatches to several tasks.
Run the job somewhere with its own limits
If a script keeps hitting its host's quotas, an Autonoly workflow can run the same steps on a schedule in an isolated cloud container, and the AI agent has a terminal with Python for steps that need code. Autonoly has limits of its own, priced in credits.
Also see Agent terminal & SSH.