Portal Community

message/get

Retrieve a single Gmail message by its ID, with optional full-content and attachment download modes.

When to Use

Configuration

Connection

FieldTypeDescription
credentialIdGuid requiredOAuth2 credential ID from BizFirst Credentials Manager. Requires gmail.readonly scope.

Operation Fields

FieldTypeDefaultDescription
messageIdstring requiredGmail message ID to retrieve.
simplebool optionaltrueWhen true, returns a simplified output (headers + metadata). When false, returns full message including body HTML/text, all headers, and attachment metadata.
downloadAttachmentsbool optionalfalseWhen true, downloads attachment binary data and includes it in the output. Only effective when simple: false.
attachmentPrefixstring optionalattachment_Prefix for binary attachment field names in the output object (e.g. attachment_0, attachment_1).

Sample Configuration

{
  "nodeType": "Gmail",
  "operation": "message/get",
  "credentialId": "a3f9d12b-44e1-4c89-b7d2-9f0a1e2b3c4d",
  "messageId": "{{trigger.messageId}}",
  "simple": false,
  "downloadAttachments": true,
  "attachmentPrefix": "file_"
}

Validation Errors

ErrorCauseResolution
MISSING_FIELD: messageIdmessageId is emptyEnsure upstream node provides a valid Gmail message ID
MESSAGE_NOT_FOUNDMessage does not exist or belongs to another accountVerify the message ID comes from the authenticated account
INVALID_CREDENTIALOAuth token expired or credential not foundRe-authenticate in BizFirst Credentials Manager
ATTACHMENT_DOWNLOAD_FAILEDAttachment binary could not be retrievedCheck attachment size limits and retry; large attachments may require chunked handling

Output

Success Port — Simple Mode (simple: true)

FieldTypeDescription
messageIdstringGmail message ID
threadIdstringThread this message belongs to
snippetstringShort preview of the message body
fromstringSender email address
tostringPrimary recipient(s)
ccstringCC recipients
subjectstringEmail subject line
datestringMessage date (RFC 2822 format)
labelIdsstring[]Applied label IDs (e.g. ["INBOX", "UNREAD"])
sizeEstimatenumberEstimated message size in bytes

Additional Fields — Full Mode (simple: false)

FieldTypeDescription
textstringPlain text body of the message
htmlstringHTML body of the message
textAsHtmlstringPlain text body converted to HTML for display
headersobjectAll email headers as key-value pairs
attachmentsarrayAttachment metadata: filename, mimeType, size, attachmentId
file_0, file_1binaryDownloaded attachment binaries (when downloadAttachments: true)

Error Port

On failure, routes to the error port with status: "error", errorCode, and errorMessage.

Sample Output

{
  "messageId": "18e4a2f9d3c0b1a7",
  "threadId": "18e4a2f9d3c0b1a7",
  "snippet": "Please find the invoice attached for your recent purchase...",
  "from": "vendor@example.com",
  "to": "accounts@bizfirstai.com",
  "cc": "",
  "subject": "Invoice #INV-2024-0591",
  "date": "Mon, 15 Jan 2024 09:34:12 +0000",
  "labelIds": ["INBOX", "UNREAD"],
  "sizeEstimate": 24580,
  "text": "Please find the invoice attached for your recent purchase...",
  "html": "<p>Please find the invoice attached for your recent purchase...</p>",
  "attachments": [
    {
      "filename": "invoice-INV-2024-0591.pdf",
      "mimeType": "application/pdf",
      "size": 21430,
      "attachmentId": "ANGjdJ8kLp..."
    }
  ],
  "status": "success",
  "errorCode": ""
}

Expression Reference

ExpressionResolves ToExample Use
{{trigger.messageId}}Message ID from upstream triggermessageId field
{{gmailGet.from}}Sender address from this node's outputCRM lookup key downstream
{{gmailGet.subject}}Email subject from this node's outputTicket title in help-desk node
{{gmailGet.attachments[0].filename}}First attachment filenameDocument routing logic
{{gmailGet.file_0}}Downloaded binary of first attachmentPass to PDF parser node

Node Policies & GuardRails

PolicyRule
Credential StorageStore OAuth credentials in BizFirst Credentials Manager — never hardcode tokens in workflow configuration
PII ProtectionDo not log email body or attachment content in workflow execution history — email content contains PII
Quota Managementmessages.get costs 5 quota units — safe for frequent reads, but avoid tight polling loops; use IMAP triggers instead
Attachment HandlingOnly enable downloadAttachments: true when the workflow requires binary processing; unnecessary downloads waste quota and memory
Simple Mode DefaultUse simple: true (default) for metadata reads; only use simple: false when body content is needed
Test IsolationTest message retrieval workflows against a dedicated test Gmail account before connecting production

Examples

Example 1: Parse Incoming Support Email

IMAP trigger fires → fetch full message to extract body and sender for CRM ticket creation.

{
  "nodeType": "Gmail",
  "operation": "message/get",
  "credentialId": "a3f9d12b-44e1-4c89-b7d2-9f0a1e2b3c4d",
  "messageId": "{{imapTrigger.messageId}}",
  "simple": false,
  "downloadAttachments": false
}

Example 2: Download Invoice Attachment for Accounting

Retrieve an invoice email with PDF attachment to pass to the accounting integration node.

{
  "nodeType": "Gmail",
  "operation": "message/get",
  "credentialId": "a3f9d12b-44e1-4c89-b7d2-9f0a1e2b3c4d",
  "messageId": "{{messageList.messages[0].messageId}}",
  "simple": false,
  "downloadAttachments": true,
  "attachmentPrefix": "invoice_"
}

Example 3: Audit Compliance Read

Read message metadata only (no body) for compliance audit trail recording.

{
  "nodeType": "Gmail",
  "operation": "message/get",
  "credentialId": "a3f9d12b-44e1-4c89-b7d2-9f0a1e2b3c4d",
  "messageId": "{{audit.targetMessageId}}",
  "simple": true,
  "downloadAttachments": false
}