Skip to content

Gmail — Archive

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

Archives an email: takes it out of the inbox without deleting it. The email stays in All Mail, with its labels, and shows up in searches. It is the usual way to keep the inbox clean after processing an email, without losing track of it.

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 archives the email (removes the INBOX label). Turn on unarchive to do the opposite: move it back to the inbox (adds INBOX). It is idempotent: archiving an already-archived email changes nothing and does not fail. The email’s id doesn’t change, so you can keep working on it afterwards.

ParameterTypeDefaultDescription
idstring—Message ID.
ParameterTypeDefaultDescription
sessionZoanGmailSession—Gmail — Connect session (inherited inside body).
unarchiveboolfalseIf true, moves the email back to the inbox; if false, archives it.

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.

Process new requests, label them and take them out of the inbox:

Gmail — Connect credential = credential("gmail-support")
└─ body:
Gmail — Get emails query = "in:inbox subject:request" → output: requests
For each email in requests
└─ Gmail — Apply label id = email["id"] labels = "Processed"
Gmail — Archive id = email["id"]