Microsoft Exchange · Arazzo Workflow

Microsoft Exchange Triage and Move a Message

Version 1.0.0

Find the newest unread inbox message, read it, mark it read, and file it.

1 workflow 2 source APIs 1 provider
View Spec View on GitHub CalendarCollaborationContactsEmailEnterpriseArazzoWorkflows

Provider

microsoft-exchange

Workflows

triage-and-move-message
Read the newest unread inbox message, flag it read, and move it.
Lists the most recent unread message in the inbox, retrieves it, updates its isRead flag, and relocates it to the supplied destination folder.
4 steps inputs: destinationId outputs: messageId, movedMessageId, subject
1
listUnread
List the single most recent unread message in the Inbox, ordered by received date descending.
2
getMessage
Retrieve the full message, selecting the subject, sender, and body preview for review.
3
markRead
Mark the message as read by patching its isRead property to true.
4
moveMessage
Move the now-read message into the destination folder. Graph returns the new copy of the message in that folder.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: Microsoft Exchange Triage and Move a Message
  summary: Find the newest unread inbox message, read it, mark it read, and file it.
  description: >-
    An inbox triage pattern built on Microsoft Graph mail. The workflow lists
    the newest messages in the Inbox filtered to unread items, fetches the full
    body of the top match, marks it as read, and then moves it into a target
    folder. Each step inlines its request so the flow can be executed without
    consulting the underlying OpenAPI description.
  version: 1.0.0
sourceDescriptions:
- name: mailFoldersApi
  url: ../openapi/microsoft-exchange-mail-folders-api-openapi.yml
  type: openapi
- name: messagesApi
  url: ../openapi/microsoft-exchange-messages-api-openapi.yml
  type: openapi
workflows:
- workflowId: triage-and-move-message
  summary: Read the newest unread inbox message, flag it read, and move it.
  description: >-
    Lists the most recent unread message in the inbox, retrieves it, updates
    its isRead flag, and relocates it to the supplied destination folder.
  inputs:
    type: object
    required:
    - destinationId
    properties:
      destinationId:
        type: string
        description: >-
          The destination mail folder id or well-known name (e.g. archive)
          to move the message into.
  steps:
  - stepId: listUnread
    description: >-
      List the single most recent unread message in the Inbox, ordered by
      received date descending.
    operationId: listMailFolderMessages
    parameters:
    - name: mailFolder-id
      in: path
      value: inbox
    - name: $filter
      in: query
      value: isRead eq false
    - name: $orderby
      in: query
      value: receivedDateTime desc
    - name: $top
      in: query
      value: 1
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      messageId: $response.body#/value/0/id
    onSuccess:
    - name: hasUnread
      type: goto
      stepId: getMessage
      criteria:
      - context: $response.body
        condition: $.value.length > 0
        type: jsonpath
    - name: inboxClear
      type: end
      criteria:
      - context: $response.body
        condition: $.value.length == 0
        type: jsonpath
  - stepId: getMessage
    description: >-
      Retrieve the full message, selecting the subject, sender, and body
      preview for review.
    operationId: getMessage
    parameters:
    - name: message-id
      in: path
      value: $steps.listUnread.outputs.messageId
    - name: $select
      in: query
      value: subject,from,bodyPreview,isRead
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      subject: $response.body#/subject
      bodyPreview: $response.body#/bodyPreview
  - stepId: markRead
    description: >-
      Mark the message as read by patching its isRead property to true.
    operationId: updateMessage
    parameters:
    - name: message-id
      in: path
      value: $steps.listUnread.outputs.messageId
    requestBody:
      contentType: application/json
      payload:
        isRead: true
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      isRead: $response.body#/isRead
  - stepId: moveMessage
    description: >-
      Move the now-read message into the destination folder. Graph returns the
      new copy of the message in that folder.
    operationId: moveMessage
    parameters:
    - name: message-id
      in: path
      value: $steps.listUnread.outputs.messageId
    requestBody:
      contentType: application/json
      payload:
        destinationId: $inputs.destinationId
    successCriteria:
    - condition: $statusCode == 201
    outputs:
      movedMessageId: $response.body#/id
      parentFolderId: $response.body#/parentFolderId
  outputs:
    messageId: $steps.listUnread.outputs.messageId
    subject: $steps.getMessage.outputs.subject
    movedMessageId: $steps.moveMessage.outputs.movedMessageId

Work with this as data

Every workflow here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for arazzo workflows

4 MCP tools reach this
  • find_arazzoBrowse and filter every workflow in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This workflow
curl "https://apis.io/api/v1/arazzo/microsoft-exchange-triage-and-move-message-workflow"
All arazzo workflows
curl "https://apis.io/api/v1/arazzo?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.