Skip to main content

Gmail Create Draft

Controlled node

Overview

The Gmail Create Draft node (shown as Create Draft in the Gmail section of the node library) creates a new draft email in the connected user's Gmail account. Nothing is sent — the draft is saved to the user's Gmail drafts folder where it can be reviewed, edited, and sent manually. This makes it ideal for human-in-the-loop workflows where an AI or automated process composes an email but a person approves it before sending.

If you provide a Message ID (and optionally a Thread ID), the node creates a draft reply attached to the same conversation as the original message. If no Message ID is provided, a standalone draft is created instead.

This is a controlled node: it only runs when it receives a Run event, and it fires a Done event when it has finished.

Connection required

This node requires a configured Gmail connection. Select the connection in the node's Connections input before running the workflow.

Inputs

InputTypeDescriptionDefault
RunEventTriggers the node to create the draft.-
ToTextPrimary recipient(s). Accepts a single email address or an array of email addresses.-
CCTextCarbon copy recipient(s). Accepts a single email address or an array of email addresses.-
BCCTextBlind carbon copy recipient(s). Accepts a single email address or an array of email addresses.-
SubjectTextThe subject line of the draft.-
Message IDTextThe ID of a Gmail message to reply to. When provided, the draft is created as a reply to that message.-
Thread IDTextThe ID of the Gmail thread the draft should belong to. Provide alongside Message ID to keep the draft reply in the original thread.-
Body TextPlainTextThe plain text body of the email.-
Body HTMLPlainTextThe HTML body of the email.-
AttachmentsDataFile(s) to attach to the draft. A single file object must include an id and a name; arrays are passed to the Gmail service.-
ConnectionsConnectionThe Gmail connection used to create the draft.-

Outputs

OutputTypeDescription
DoneEventFires when the node has finished running.
StatusTextThe result of the operation. Contains the service status on success, or a message beginning with failed: describing what went wrong.
Draft IDTextThe ID of the created draft. Empty if the draft could not be created.

Runtime behavior

  • Empty fields are ignored. Any input left as an empty string is treated as unset, so optional fields can be left blank or wired to values that may be empty.
  • Email validation. The To, CC, and BCC inputs are validated before the draft is created. Each must be a valid email address string or an array of valid email address strings. If validation fails, no draft is created and Status is set to a failed: message explaining which field was invalid.
  • Attachment handling. A single attachment object with id and name is automatically wrapped into an array. The node passes attachment arrays through to the Gmail service without validating every item first.
  • Draft replies. When Message ID is provided, the draft is created as a reply to that message. Providing the matching Thread ID ensures the reply stays in the same conversation thread.
  • Failure handling. Exceptions are reported as failed: <message>. A service response without a status produces failed to create draft, and Draft ID remains empty. The Done event still fires, so downstream nodes should inspect Status.
  • No defaults. All fields start empty; only the Connections input must be configured for the node to succeed.

Example

Draft an AI-generated reply to the most recent email in the inbox:

  1. Add a Gmail Get Inbox node and run it to fetch messages. From the first message, take its id, threadId, sender address, and subject.
  2. Add an AI Write node with a prompt such as "Write a polite reply to this email: ..." to generate the reply body.
  3. Add a Gmail Create Draft node and wire:
    • The sender's address into To
    • Re: <subject> into Subject
    • The AI Write output into Body Text
    • The message id into Message ID
    • The message threadId into Thread ID
  4. Connect the Done event of AI Write into the Run event of Gmail Create Draft.
  5. Connect the Done event of Gmail Create Draft to downstream logic that checks Status and surfaces the Draft ID, so a user can open the draft in Gmail, review it, and send it manually.