Skip to main content
gmail.onMessageDeleted handles permanent Gmail message deletion. Moving a message to Trash doesn’t qualify.

Example

automations/record-deleted-message.automation.ts

Options

account is a static Google Account binding and defaults to the project binding. It can’t change at runtime.

Trigger data

Gmail reports only stable identifiers after permanent deletion because the message resource is no longer available. historyId identifies the mailbox history record that reported the lifecycle.