Portal Community

label/get

Retrieve full details for a specific Gmail label by its ID, including message and thread counts.

When to Use

Configuration

Connection

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

Operation Fields

FieldTypeDefaultDescription
labelIdstring requiredGmail label ID to retrieve. Use system label IDs (INBOX, SENT, etc.) or user label IDs from label/getMany.

Sample Configuration

{
  "nodeType": "Gmail",
  "operation": "label/get",
  "credentialId": "a3f9d12b-44e1-4c89-b7d2-9f0a1e2b3c4d",
  "labelId": "INBOX"
}

Validation Errors

ErrorCauseResolution
MISSING_FIELD: labelIdlabelId is emptyProvide a valid label ID (system or user)
LABEL_NOT_FOUNDLabel ID does not exist in this accountUse label/getMany to enumerate valid label IDs
INVALID_CREDENTIALOAuth token expired or credential not foundRe-authenticate in BizFirst Credentials Manager

Output

Success Port

FieldTypeDescription
labelIdstringGmail label ID
namestringLabel display name
labelListVisibilitystringLabel list visibility setting
messageListVisibilitystringMessage list visibility setting
typestringsystem for system labels, user for user-created labels
messagesTotalnumberTotal number of messages with this label
messagesUnreadnumberNumber of unread messages with this label
threadsTotalnumberTotal number of threads with this label
threadsUnreadnumberNumber of unread threads with this label
statusstringsuccess
errorCodestringEmpty on success

Error Port

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

Sample Output

{
  "labelId": "INBOX",
  "name": "INBOX",
  "labelListVisibility": "labelShow",
  "messageListVisibility": "show",
  "type": "system",
  "messagesTotal": 1452,
  "messagesUnread": 23,
  "threadsTotal": 890,
  "threadsUnread": 18,
  "status": "success",
  "errorCode": ""
}

Expression Reference

ExpressionResolves ToExample Use
{{labelGet.messagesUnread}}Count of unread messages in the labelThreshold check for alerting
{{labelGet.threadsTotal}}Total thread count for reportingDashboard metric node
{{labelGet.name}}Label display nameNotification or report title

Node Policies & GuardRails

PolicyRule
Credential StorageStore OAuth credentials in BizFirst Credentials Manager — never hardcode tokens in workflow configuration
System LabelsSystem label IDs are constants and do not require lookup — use INBOX, SENT, etc. directly
Quota ManagementLabel get operations cost 1 quota unit — safe for frequent polling in monitoring workflows
Count FreshnessMessage/thread counts are approximate and may have a short propagation delay — not suitable for exact real-time counting
PII ProtectionLabel names may reflect sensitive organizational structure — do not log label metadata in public-facing audit trails
Test IsolationTest label monitoring workflows against a dedicated Gmail test account

Examples

Example 1: Inbox Unread Count Alert

Poll INBOX unread count every 30 minutes and send a Slack alert if it exceeds 50.

{
  "nodeType": "Gmail",
  "operation": "label/get",
  "credentialId": "a3f9d12b-44e1-4c89-b7d2-9f0a1e2b3c4d",
  "labelId": "INBOX"
}

Example 2: Support Queue Depth Report

Retrieve the "Support/Open" label message count for a daily queue depth report to management.

{
  "nodeType": "Gmail",
  "operation": "label/get",
  "credentialId": "a3f9d12b-44e1-4c89-b7d2-9f0a1e2b3c4d",
  "labelId": "{{labelLookup.supportOpenLabelId}}"
}

Example 3: Label Existence Verification

Before applying a label, verify it exists and retrieve its current properties for conditional logic.

{
  "nodeType": "Gmail",
  "operation": "label/get",
  "credentialId": "a3f9d12b-44e1-4c89-b7d2-9f0a1e2b3c4d",
  "labelId": "{{workflowConfig.processingLabelId}}"
}