Skip to main content

Outlook

The Outlook connector lets an Unstract Flow workflow read conversations from an Outlook or Microsoft 365 mailbox, send mail and replies, and move conversations between folders. Mention it as @email_outlook. Each run can take the next conversation as a pipeline item.

Connect​

The credential is an OAuth sign-in. In the credential dialog, enter a Credential Name, select Connect with Microsoft, and sign in to Microsoft in the pop-up window. Flow asks for permission to read and send mail. Connectors, instances and credentials covers the rest of the setup.

SettingDefaultWhat it does
Mail FolderinboxThe folder the workflow reads, by a well-known name such as inbox or archive, or by folder ID.
Azure AD Tenant IDcommonThe tenant the connector uses when a sign-in expires during a run. Flow's regular renewal goes through Microsoft's common endpoint.

What a step can do​

ActionWhat it does
claim_next_threadClaims the next conversation: one queued again by a new message in the last 24 hours first, then the available conversation that entered the pipeline first. A conversation queued again more than 24 hours ago comes after all of them.
list_threadsLooks at the folder's newest conversations, as many as the step asks for (one by default). It returns those that aren't done, Failed or in use, and adds new ones to the pipeline.
get_threadReads a conversation's messages, up to 100, from every folder including Sent Items, and saves its attachments to the run's files. Zip and tar attachments are unpacked. When two attachments share a file name, the second is saved as scan (1).pdf, and so on. An attached email is saved as an .eml file and unpacked. A link to a cloud file has nothing to save: the step's extraction_warnings names it. So does an attachment that is no longer in the mailbox, or that Outlook refuses to send; the conversation is read without it. When Outlook is busy, the read fails and the conversation is given back.
send_messageSends a new message, or replies within a conversation. It can attach files from the run, such as a PDF an earlier step made.
set_flagMoves the conversation's messages to a folder, named by a well-known name such as archive or by folder ID. It moves them from every folder except Sent Items and Drafts, so your replies stay where they are, or only from the folder a step names. It moves up to 1,000 messages at a time. When more are left, the step fails and says so, so the conversation isn't marked done; run it again to move the rest. Messages already in the target folder are skipped.
refresh_pipelineLooks for new conversations, and for new messages on conversations already processed.
mark_thread_processedMarks a claimed conversation Success or Failed when the run has finished with it.

Take the next conversation from @email_outlook. Save each PDF attachment to @extfs_sharepoint under Invoices/. Then move the conversation to archive.

How runs read the mailbox​

Flow reads the mailbox only while a run is going. A run claims a conversation queued again by a new message in the last 24 hours, if there is one, and otherwise the available conversation that entered the pipeline first. A conversation queued again more than 24 hours ago comes after all of them. The run reads the conversation, and the conversation moves to Staged. When the run has finished with it, the conversation is marked Success or Failed.

Each check for new conversations reads the mail folder's messages, up to 5,000, and queues conversations oldest first.

A conversation marked Success is queued again when a new message arrives in the folder for it, including one marked done without being read: a message that arrived after it was marked done is new, one from before isn't. A reply the workflow sent, or marking a message read, doesn't queue it. A conversation marked Failed stays Failed: no run claims it again, and a new message on it doesn't queue it. When reading a conversation fails because the mail service is busy or unavailable, or the mailbox sign-in fails, the conversation isn't marked Failed: the run gives it back, and a retry or the next run reads it. Each time, the conversation waits 5 minutes before claim_next_thread offers it again, so the other conversations go first. When every conversation left is waiting, the claim takes nothing and its message says how many wait; a run after the wait picks them up. A retry that fails during those 5 minutes isn't counted. The third counted failure in a row marks it Failed with the error. To process a Failed conversation again, select Reset Status on it.

Limitations
  • If a run stops after claiming a conversation, the conversation stays Claimed, or Staged once the run has read it. To process it again, someone with the Owner, Admin or Member role selects Release claims in the run's details, or Reset Status on the conversation. Release claims returns a Staged conversation only with Also release items this run already read or finished ticked, since the run may already have replied to it. Once the claim is 8 hours old and its run has ended, a Claimed conversation is marked Failed, and so is a Staged one when its run ended Failed or Cancelled; the check runs every 5 minutes. After a run that ended Succeeded or Partial, a Staged conversation stays Staged until someone releases or resets it.
  • A message the mailbox's owner sent never queues a processed conversation again, even one sent to the mailbox itself. Otherwise the workflow's own reply on such a conversation would queue it on every check.
  • A workflow prepared before mark_thread_processed existed doesn't call it, so its conversations stay Staged and a new message doesn't queue them again. Prepare the workflow again. To process one conversation again by hand, open its pipeline tab in the editor, under Email, and select Reset Status on it.
  • A message can carry up to 10 attachments of 3 MB each, 20 MB in total. Attach a file from the run's files by its path. The step fails at the first file that goes over a limit, before it reads that file. A file given as its content instead passes through the workflow, which holds all of it in memory, so give a large file by its path.
  • The first check queues every conversation among the folder's 5,000 newest messages, old ones included. To process only new mail, set an Outlook rule that moves it to its own folder, and set Mail Folder to that folder's ID. A folder's name doesn't work there.
  • A step that names a folder when it takes the next conversation reads only that folder's 1,000 newest messages. It takes the waiting conversation among them whose latest message arrived first, and never a Failed one. If another run claims that one first, it takes the next. Set the folder in Mail Folder to reach older mail.
  • Sign-in always goes through Microsoft's common endpoint. Azure AD Tenant ID applies only when the connector renews an expired sign-in during a run.