Skip to content

Gmail — Mark read/unread

Type: gmail-mark-read  ·  Package: Gmail v1.0.4  ·  Output: —

Marks an email as read or unread. Useful to avoid processing a handled email again: after handling it, mark it as read and the next is:unread search won’t bring it back.

It works on the session created with Gmail — Connect. Pass it in the session parameter, or place this activity inside the body of Gmail — Connect to inherit it automatically.

By default it marks as read (removes the UNREAD label). Turn on unread to mark it as unread (adds the label). It is idempotent: marking an already-read email as read changes nothing and does not fail.

ParameterTypeDefaultDescription
idstring—Message ID.
ParameterTypeDefaultDescription
sessionZoanGmailSession—Gmail — Connect session (inherited inside body).
unreadboolfalseIf true, marks as unread; if false, as read.

This activity does not return a value.

MessageCause and fix
'id' is required.id is empty or the expression returned null.
Requested entity was not found.No email with that ID exists in the mailbox.
Gmail — Connect credential = credential("gmail-support")
└─ body:
Gmail — Get emails query = "is:unread in:inbox" → output: newEmails
For each email in newEmails
└─ Gmail — Download attachments id = email["id"] folder = "C:\inbox"
Gmail — Mark read/unread id = email["id"]