draft/get
Retrieve a specific Gmail draft by its draft ID, including full message content and optionally downloaded attachments.
When to Use
- Approval workflow inspection: Retrieve a draft before routing it to a human approver, so the approval notification includes the draft's subject and body preview.
- Content verification before send: After an AI node generates and saves a draft, retrieve it to verify content against a validation rule before proceeding.
- Draft modification pipeline: Retrieve an existing draft to extract its content, modify it in a transformation node, then delete the old draft and create a new one with the updated content.
- Audit trail capture: Retrieve draft content at key workflow checkpoints and log it to an audit store for compliance purposes.
- Attachment verification: Download draft attachments to verify their content (file size, format) before the draft is approved for sending.
Configuration
Connection
| Field | Type | Description |
credentialId | Guid required | OAuth2 credential ID from BizFirst Credentials Manager. Requires gmail.readonly scope. |
Operation Fields
| Field | Type | Default | Description |
draftId | string required | — | Gmail draft ID to retrieve. Returned by draft/create or draft/getMany. |
downloadAttachments | bool optional | false | When true, downloads attachment binary data and includes it in the output. |
Sample Configuration
{
"nodeType": "Gmail",
"operation": "draft/get",
"credentialId": "a3f9d12b-44e1-4c89-b7d2-9f0a1e2b3c4d",
"draftId": "{{draftCreate.draftId}}",
"downloadAttachments": false
}
Validation Errors
| Error | Cause | Resolution |
MISSING_FIELD: draftId | draftId is empty | Ensure upstream node (draft/create or draft/getMany) provides a valid draft ID |
DRAFT_NOT_FOUND | Draft does not exist or was already sent/deleted | Verify the draft ID is current; drafts are removed when sent |
INVALID_CREDENTIAL | OAuth token expired or credential not found | Re-authenticate in BizFirst Credentials Manager |
Output
Success Port
| Field | Type | Description |
draftId | string | Gmail draft ID |
messageId | string | Underlying message ID |
threadId | string | Thread ID if draft is a reply |
from | string | Draft sender address |
to | string | Draft recipient(s) |
subject | string | Draft subject line |
snippet | string | Short body preview |
html | string | HTML body of the draft |
text | string | Plain text body of the draft |
attachments | array | Attachment metadata (filename, mimeType, size) |
status | string | success |
errorCode | string | Empty on success |
Error Port
On failure, routes to the error port with status: "error", errorCode, and errorMessage.
Sample Output
{
"draftId": "r9876543210abcdef",
"messageId": "18e4c3d2e1f0a9b8",
"threadId": "18e4c3d2e1f0a9b8",
"from": "sender@bizfirstai.com",
"to": "client@example.com",
"subject": "Proposal — Project Alpha",
"snippet": "Dear Client, please find the project proposal attached...",
"html": "<p>Dear Client...</p>",
"text": "Dear Client...",
"attachments": [
{ "filename": "proposal.pdf", "mimeType": "application/pdf", "size": 45230 }
],
"status": "success",
"errorCode": ""
}
Expression Reference
| Expression | Resolves To | Example Use |
{{draftCreate.draftId}} | Draft ID from upstream draft/create node | draftId field |
{{draftGet.subject}} | Draft subject for approval notification | HIL approval node message |
{{draftGet.html}} | Draft HTML body for content verification | Validation rule input |
{{draftGet.attachments[0].size}} | Size of first attachment in bytes | File size validation check |
Node Policies & GuardRails
| Policy | Rule |
| Credential Storage | Store OAuth credentials in BizFirst Credentials Manager — never hardcode tokens in workflow configuration |
| PII Protection | Do not log draft content in workflow execution history — drafts contain pre-send email content which may include PII |
| Draft Lifecycle | After retrieving a draft for inspection, ensure the workflow either sends it or deletes it — do not leave stale drafts in the inbox |
| Quota Management | Draft get operations cost minimal quota units — safe for frequent use in approval workflows |
| Attachment Downloads | Only enable downloadAttachments: true when binary content is required for the workflow — unnecessary downloads waste memory |
| Test Isolation | Test draft retrieval workflows against a dedicated Gmail test account |
Examples
Example 1: Pre-Approval Content Check
Retrieve a draft to include a subject/snippet preview in the approval request sent to a manager.
{
"nodeType": "Gmail",
"operation": "draft/get",
"credentialId": "a3f9d12b-44e1-4c89-b7d2-9f0a1e2b3c4d",
"draftId": "{{draftCreate.draftId}}"
}
Example 2: Attachment Size Validation
Retrieve draft with attachment metadata to verify the attached file does not exceed the email size limit.
{
"nodeType": "Gmail",
"operation": "draft/get",
"credentialId": "a3f9d12b-44e1-4c89-b7d2-9f0a1e2b3c4d",
"draftId": "{{draftCreate.draftId}}",
"downloadAttachments": false
}
Example 3: Content Modification Pipeline
Retrieve draft content, pass through a transformation node, delete old draft, and create an updated one.
{
"nodeType": "Gmail",
"operation": "draft/get",
"credentialId": "a3f9d12b-44e1-4c89-b7d2-9f0a1e2b3c4d",
"draftId": "{{draftStore.savedDraftId}}"
}