Using a Script Trigger in a Google Workspace AddOn

175 views
Skip to first unread message

Joshua Snyder

unread,
Apr 10, 2021, 1:16:48 PM4/10/21
to Google Apps Script Community
So I have recently discovered triggers and I am trying to use an installable trigger (EventUpdated trigger) in a Google Workspace Add-On I have built (that runs alongside Google Calendar, so it's a Card based Add-On).

The problem is, triggers don't seem to be working so well on the V8 runtime (see here), and for many users (though not all) my triggers get Disabled for an unknown reason the first time they are triggered.

I thought it might be an issue with my code, so I created a trigger that runs an empty function and got the same result.

Has anyone got triggers working reliably on a workspace Add-On?

I tried to downgrade to Rhino and used some polyfills for the missing functions, but in Rhino the Add-On doesn't load at all. (I get a bunch of errors about missing sections at build time). Are card based Add-On's working properly on the Rhino runtime?

I've managed to hack my way out of most annoyances so far, but this one has had me puzzled for a while. Any thoughts/discussion would be much appreciated.

Joshua Snyder

unread,
Apr 13, 2021, 5:10:08 AM4/13/21
to Google Apps Script Community
Anyone have any insight to getting triggers working for Add-On's on the V8 runtime?

I still can't think of a good hack to solve this problem and downgrading to Rhino doesn't work for me either.

Clark Lind

unread,
Apr 13, 2021, 4:58:29 PM4/13/21
to Google Apps Script Community

Clark Lind

unread,
Apr 13, 2021, 8:52:38 PM4/13/21
to Google Apps Script Community
In your example, you have the trigger running every minute correct? And you said it runs once and then stops or fails?  You may also be running into this limitation:

(Note that an add-on can use a time-driven trigger once per hour at most.) 

from:

Joshua Snyder

unread,
Apr 14, 2021, 9:04:30 AM4/14/21
to Google Apps Script Community
Thanks for your response, I am actually using the EventUpdated installable trigger, rather than a time trigger.

Since this is an installable trigger, it is available for Google Workspace Add-On's so their shouldn't be any limitations (which I can confirm, as I've got them to work for some users, but then others Disable for an unknown reason).
Reply all
Reply to author
Forward
0 new messages