gmail.onMessageAdded handles every message Gmail adds to the mailbox, including received, sent, inserted, imported, and draft messages.
Example
automations/inspect-added-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
Returns the complete parsedMessage documented by Get message. Use On new email for the INBOX subset or On email sent for messages sent by the watched mailbox.
Existing messages establish the watch cursor and aren’t replayed when you deploy the trigger. Automate.ax deduplicates repeated Gmail notifications and suppresses recursive delivery to the automation that originated an authenticated message.