Portal Community

Output Ports

PortTriggerDescription
successOperation completed successfullyGmail API returned a 2xx response. Output data is available on this port.
errorAPI error or network failureThe Gmail API returned an error, the OAuth2 token was invalid or expired, or a network fault occurred. Error details are in the error output object.
message — Output Schemas

message/send and message/reply — Output

FieldTypeDescription
idstringGmail message ID of the sent or replied message.
threadIdstringThread ID this message belongs to. For new sends, this is a new thread. For replies, it matches the original thread.
labelIdsstring[]Labels applied to the sent message, typically ["SENT"].
{
  "id": "18f3c2b4a5d6e789",
  "threadId": "18f3c2b4a5d6e789",
  "labelIds": ["SENT"]
}

message/get — Output (Simplified: true)

FieldTypeDescription
idstringGmail message ID.
threadIdstringThread this message belongs to.
labelIdsstring[]Labels currently applied to the message.
fromstringSender email address and display name (e.g. "Acme Corp <billing@acme.com>").
tostringPrimary recipient(s).
subjectstringEmail subject line.
datestringMessage date in RFC 2822 format.
snippetstringShort text preview as shown in the Gmail message list.
bodyTextstringDecoded plain text body.
bodyHtmlstringDecoded HTML body, if present.
attachmentsobject[]Attachment metadata. See attachment schema below. Binary data present when DownloadAttachments: true.
{
  "id": "18c1f2e3d4c5b6a7",
  "threadId": "18c1f2e3d4c5b6a7",
  "labelIds": ["INBOX", "UNREAD"],
  "from": "supplier@vendorcorp.com",
  "to": "accounts@mycompany.com",
  "subject": "Invoice #INV-2026-0312",
  "date": "Fri, 23 May 2026 09:15:03 +0000",
  "snippet": "Please find attached invoice #INV-2026-0312...",
  "bodyText": "Please find attached invoice #INV-2026-0312 for services rendered in April 2026. Amount: $4,250.00.",
  "bodyHtml": "<p>Please find attached invoice...</p>",
  "attachments": [
    {
      "attachmentId": "ANGjdJ8Kx2aP...",
      "filename": "Invoice_INV-2026-0312.pdf",
      "mimeType": "application/pdf",
      "size": 87432
    }
  ]
}

message/getMany — Output

FieldTypeDescription
messagesobject[]Array of message objects. Each entry has the same schema as message/get output when Simplified: true.
nextPageTokenstringPagination token for the next page of results. Empty when all results have been returned.
resultSizeEstimateintegerEstimated total number of matching messages.

message/delete, message/trash, message/untrash, message/markAsRead, message/markAsUnread — Output

FieldTypeDescription
successbooleantrue when the operation completed without error.
idstringThe message ID that was acted upon.

message/addLabel — Output

FieldTypeDescription
idstringThe message ID.
threadIdstringThe thread ID.
labelIdsstring[]Updated full list of label IDs on the message after the operation.
draft — Output Schemas

draft/create — Output

FieldTypeDescription
idstringGmail draft ID for the newly created draft.
messageobjectThe draft message object, containing id, threadId, and labelIds.
{
  "id": "r-7894561230abcdef",
  "message": {
    "id": "18f4a1b2c3d4e567",
    "threadId": "18f4a1b2c3d4e567",
    "labelIds": ["DRAFT"]
  }
}

draft/get — Output

FieldTypeDescription
idstringDraft ID.
messageobjectFull message object for the draft, same schema as message/get with Simplified: true.

draft/getMany — Output

FieldTypeDescription
draftsobject[]Array of draft objects, each with id and message fields.
nextPageTokenstringPagination token.
resultSizeEstimateintegerEstimated total number of drafts.
label — Output Schemas

label/create and label/get — Output

FieldTypeDescription
idstringGmail label ID (e.g. "Label_5823947123" for custom labels).
namestringLabel display name.
labelListVisibilitystring"labelShow" or "labelHide".
messageListVisibilitystring"show" or "hide".
messagesTotalintegerTotal messages with this label (present on label/get).
messagesUnreadintegerUnread message count for this label (present on label/get).

label/getMany — Output

FieldTypeDescription
labelsobject[]Array of label objects, each with id, name, and visibility fields.
thread — Output Schemas

thread/get — Output (Simplified: true)

FieldTypeDescription
idstringGmail thread ID.
snippetstringSnippet from the most recent message in the thread.
historyIdstringGmail history ID for change tracking.
messagesobject[]Array of simplified message objects in the thread, ordered oldest to newest.

thread/reply — Output

Same schema as message/send — returns id, threadId, and labelIds for the reply message.

thread/addLabel and thread/removeLabel — Output

FieldTypeDescription
idstringThread ID.
historyIdstringUpdated history ID after label modification.

Attachment Object Schema

Present in message/get, message/getMany, draft/get, and the Gmail Trigger when DownloadAttachments: true.

FieldTypeDescription
attachmentIdstringGmail attachment ID. Used to fetch attachment data via the Gmail API if not downloaded inline.
filenamestringOriginal filename of the attachment.
mimeTypestringMIME type (e.g. "application/pdf", "image/png").
sizeintegerFile size in bytes.

When DownloadAttachments: true, each attachment's binary data is mapped to a separate binary field named {AttachmentPrefix}{index} (e.g. attachment_0, attachment_1).

Error Codes

HTTP StatusCauseResolution
401OAuth2 token expired or revokedRe-authorise the credential in BizFirst Credentials Manager and ensure the OAuth2 consent includes Gmail access.
403Insufficient Gmail API scope or quota exceededVerify the credential has full Gmail access. Check the Google Cloud Console for quota usage on the Gmail API.
404MessageId, ThreadId, DraftId, or LabelId not foundConfirm the ID is valid and belongs to the authenticated account. IDs from other accounts will return 404.
429Gmail API rate limit exceededReduce concurrent Gmail node executions. Add a Delay node between bulk operations.
500Gmail API internal errorTransient error. Retry the operation. If persistent, check Google Workspace Status Dashboard.

Referencing Output in Downstream Nodes

If a Gmail node is named fetchEmail, reference its output fields using the following patterns:

Value NeededExpression
Message ID{{ nodes.fetchEmail.output.id }}
Thread ID{{ nodes.fetchEmail.output.threadId }}
Sender address{{ nodes.fetchEmail.output.from }}
Subject line{{ nodes.fetchEmail.output.subject }}
Plain text body{{ nodes.fetchEmail.output.bodyText }}
HTML body{{ nodes.fetchEmail.output.bodyHtml }}
First attachment filename{{ nodes.fetchEmail.output.attachments[0].filename }}
Label list from message/send{{ nodes.sendEmail.output.labelIds }}
Draft ID{{ nodes.createDraft.output.id }}
Custom label ID{{ nodes.listLabels.output.labels[0].id }}
Thread ID reuse: When chaining a message/get or message/getMany with a subsequent thread/reply, pass {{ nodes.getMsg.output.threadId }} as the ThreadId for the reply operation to maintain conversation continuity.