Skip to main content
gmail.updateDraft changes content, recipients, or attachments without sending the draft or moving it to another thread.

Example

automations/update-approved-draft.automation.ts

Inputs

Recipient is an email string or { address: string; name?: string }. Attachment is a File or an object containing file with optional filename, contentId, and disposition: "attachment" | "inline". Inputs accept compatible signals. Supplying either html or text replaces both body alternatives. If you supply only html, Automate.ax derives replacement plain text. Supplying attachments replaces the complete attachment list. Use [] to remove all attachments.
Omitted recipients, sender, reply addresses, subject, body, and attachments are preserved. Custom headers and priority are applied only when supplied; existing arbitrary headers and priority are not copied forward.
The updated draft carries an authenticated automation origin. If it’s sent later, Gmail triggers don’t wake the automation that updated it, while other automations watching the mailbox still receive the event.

Output

Returns Signal<DraftIdentifier>: