Skip to main content
onGmailLabelAdded subscribes an automation to label additions in the connected Gmail mailbox. It emits both user-label and system-label changes.

Example

automations/prioritize-customer-email.automation.ts

Options

The account selection must be static. Call onGmailLabelAdded() without an options object to use the default Google binding.

Trigger data

Returns a Signal<GmailLabelChange> for each Gmail history change:
message is the same fully parsed shape returned by Get message. One event can contain several labels when Gmail records them in the same change. Use labelId as the stable identity; name reflects the label’s current name when Gmail can resolve it.