Portal Community

message/markAsRead

Remove the UNREAD label from a Gmail message, marking it as read programmatically.

When to Use

Configuration

Connection

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

Operation Fields

FieldTypeDefaultDescription
messageIdstring requiredGmail message ID to mark as read. Removes the system UNREAD label.

Sample Configuration

{
  "nodeType": "Gmail",
  "operation": "message/markAsRead",
  "credentialId": "a3f9d12b-44e1-4c89-b7d2-9f0a1e2b3c4d",
  "messageId": "{{processedEmail.messageId}}"
}

Validation Errors

ErrorCauseResolution
MISSING_FIELD: messageIdmessageId is emptyEnsure upstream node provides a valid message ID
MESSAGE_NOT_FOUNDMessage does not exist in the accountVerify message ID comes from the authenticated account
INVALID_CREDENTIALOAuth token expired or credential not foundRe-authenticate in BizFirst Credentials Manager
PERMISSION_DENIEDCredential lacks gmail.modify scopeRe-grant OAuth permissions with the correct scope

Output

Success Port

FieldTypeDescription
successbooltrue when the UNREAD label was removed
statusstringsuccess
errorCodestringEmpty on success

Error Port

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

Sample Output

{
  "success": true,
  "status": "success",
  "errorCode": ""
}

Expression Reference

ExpressionResolves ToExample Use
{{processedEmail.messageId}}Message ID from upstream processing nodemessageId field
{{imapTrigger.messageId}}Message ID from IMAP triggerMark as read after workflow acknowledgment
{{loop.current.messageId}}Current message in a batch LoopBatch mark-as-read operation

Node Policies & GuardRails

PolicyRule
IdempotencyCalling markAsRead on an already-read message is safe — it is a no-op with a success response
Credential StorageStore OAuth credentials in BizFirst Credentials Manager — never hardcode tokens in workflow configuration
Processing GateAlways mark as read AFTER all processing steps complete — not before — to prevent race conditions with other unread-filter workflows
Quota ManagementmarkAsRead (modify) costs minimal quota units — safe for high-frequency and batch workflows
PII ProtectionDo not log message IDs in combination with personal data in workflow execution history
Test IsolationTest mark-as-read workflows against a dedicated Gmail test account to avoid affecting production inbox state

Examples

Example 1: Mark Read After Ticket Creation

After an IMAP trigger fires, the workflow creates a support ticket and then marks the source email as read.

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

Example 2: Batch Mark Digest Emails as Read

After extracting content from newsletter digest emails, mark them all as read in a Loop node.

{
  "nodeType": "Gmail",
  "operation": "message/markAsRead",
  "credentialId": "a3f9d12b-44e1-4c89-b7d2-9f0a1e2b3c4d",
  "messageId": "{{loop.current.messageId}}"
}

Example 3: SLA Read Timestamp

Mark email as read immediately when the support workflow acknowledges receipt, capturing SLA start time.

{
  "nodeType": "Gmail",
  "operation": "message/markAsRead",
  "credentialId": "a3f9d12b-44e1-4c89-b7d2-9f0a1e2b3c4d",
  "messageId": "{{supportTriage.messageId}}"
}