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.
This node requires a configured Gmail connection. Select the connection in the node's Connections input before running the workflow.
Inputs
| Input | Type | Description | Default |
|---|---|---|---|
| Run | Event | Triggers the node to create the draft. | - |
| To | Text | Primary recipient(s). Accepts a single email address or an array of email addresses. | - |
| CC | Text | Carbon copy recipient(s). Accepts a single email address or an array of email addresses. | - |
| BCC | Text | Blind carbon copy recipient(s). Accepts a single email address or an array of email addresses. | - |
| Subject | Text | The subject line of the draft. | - |
| Message ID | Text | The ID of a Gmail message to reply to. When provided, the draft is created as a reply to that message. | - |
| Thread ID | Text | The ID of the Gmail thread the draft should belong to. Provide alongside Message ID to keep the draft reply in the original thread. | - |
| Body Text | PlainText | The plain text body of the email. | - |
| Body HTML | PlainText | The HTML body of the email. | - |
| Attachments | Data | File(s) to attach to the draft. A single file object must include an id and a name; arrays are passed to the Gmail service. | - |
| Connections | Connection | The Gmail connection used to create the draft. | - |
Outputs
| Output | Type | Description |
|---|---|---|
| Done | Event | Fires when the node has finished running. |
| Status | Text | The result of the operation. Contains the service status on success, or a message beginning with failed: describing what went wrong. |
| Draft ID | Text | The 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
idandnameis 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 producesfailed 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:
- Add a Gmail Get Inbox node and run it to fetch messages. From the first message, take its
id,threadId, sender address, andsubject. - Add an AI Write node with a prompt such as "Write a polite reply to this email: ..." to generate the reply body.
- 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
idinto Message ID - The message
threadIdinto Thread ID
- Connect the Done event of AI Write into the Run event of Gmail Create Draft.
- 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.