Two Email (IMAP) steps tidy the mailbox once a workflow has dealt with an email: Move an email — Moves an email to another folder — and Mark read or unread — Marks an email read or unread. Both work on the email the New email trigger found, by its uid.

Who can do this

Workspace Admins and Editors, on every plan.

Before you start

Steps

Move an email:

  1. Select + where the email should be moved. In Apps, select Email (IMAP), then Move an email.
  2. In Connection, choose the same mailbox the trigger uses.
  3. In Folder, choose the folder the email is in now — The folder the email is in now — the trigger's folder. Empty is the inbox. If the trigger watches the inbox, leave Choose….
  4. In Email, type {{ trigger.uid }} — The email's uid, from New email.
  5. In Move to, choose the folder — for example Processed.

Mark read or unread:

  1. Select +, then in Apps select Email (IMAP), then Mark read or unread.
  2. Choose the Connection, and set Folder as above.
  3. In Email, type {{ trigger.uid }}.
  4. Under Mark as, choose Read (the default) or Unread.

To set Folder or Move to from an earlier step instead of the list, select Use a value above it and type, for example, {{ trigger.folder }}.

Output

Step Fields
Move an email uid — the email's new uid in the folder it moved to, empty if the server does not say — folder (where it is now), moved (true).
Mark read or unread uid, folder, read (true for Read, false for Unread).

Good to know

  • A uid belongs to its folder. Moving gives the email a new uid in the new folder. A step after a move that marks it must use {{ steps.move_an_email.uid }}, with Folder set to the folder it moved to.
  • Folder must be where the email is. The step looks for the uid in Folder. If the email is somewhere else — already moved, or the trigger watches another folder — the step fails and says so, and nothing changes.
  • Folders are listed by their full name, so a subfolder shows as Clients/Northwind or Clients.Northwind, as the server names it.
  • Runs once per item.
  • To mark every email the trigger takes as read, switch on Mark as read after on the trigger instead of adding a step.

If something goes wrong

What you see Why What to do
There is no email with uid 42 in INBOX — it may have been moved or deleted, or Folder is not where it is. The email is not in Folder — moved already, or Folder is not the trigger's folder. Set Folder to where the email is, such as the trigger's folder.
Email is not an email's uid — use {{ trigger.uid }}. Email holds something other than a uid — the subject, or the messageId. Put {{ trigger.uid }} in Email.
Email is empty when the step ran — an earlier step may not have given the value it names. The value in Email came out empty. Check the run's trigger output has a uid.
Move to is empty when the step ran — … No folder was set to move to. Choose a folder in Move to.
The mailbox has no folder named Archive. The folder was renamed or deleted in the mailbox. Choose the folder again.
This is no longer in the account's list. Choose again, or use a value from an earlier step. The chosen folder is gone. Choose again.
The mail server refused the username or password. … The mailbox's password changed. Reconnect the connection on Connections.