Skip to main content
draftReply creates an unsent reply to a specific Gmail message. It derives the recipient, subject, and conversation headers from that message, which keeps the draft attached to the original thread.

Example

automations/draft-inbox-reply.automation.ts
The messageId must identify the message being answered, 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". Every input, including account, also accepts a compatible Signal.
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, RFC Message-ID, and either Reply-To or From header. The action fails if those reply headers are missing.

Output

Returns a Signal<DraftIdentifier> with: