Skip to main content
updateDraft updates an existing Gmail draft without sending it. Use it to add reviewed content, change recipients, or replace attachments while keeping the draft in its existing 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". Every input, including account, also accepts a compatible Signal. 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.

Output

Returns a Signal<DraftIdentifier> with: