Skip to main content
gmail.draftReply derives a reply’s recipient, subject, and conversation headers from a Gmail message and saves it in the same thread.

Example

automations/draft-inbox-reply.automation.ts
The messageId must identify the message you want to answer, not merely another message in the same thread.

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.
replyAll: true may add every original To and Cc recipient. Review the draft before sending when the conversation contains sensitive recipients.
Gmail must return the source message’s thread ID, subject, standard Message-ID, and either Reply-To or From header. The action fails if those reply headers are missing. The draft carries an authenticated automation origin. If it’s sent later, Gmail triggers don’t wake the automation that created it, while other automations watching the mailbox still receive the event.

Output

Returns Signal<DraftIdentifier>: