Microsoft Exchange · Arazzo Workflow

Microsoft Exchange Compose, Attach, and Send Mail

Version 1.0.0

Create a draft message, add a file attachment to it, then send the draft.

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

Provider

microsoft-exchange

Workflows

compose-attach-send-mail
Draft a message, attach a file, and send it via Microsoft Graph.
Creates a draft message with subject, body, and recipients, adds a single file attachment to the draft, and submits the draft for delivery.
3 steps inputs: attachmentContentBytes, attachmentContentType, attachmentName, bodyContent, subject, toAddress outputs: attachmentId, messageId, sentStatus
1
createDraft
Create a draft message in the Drafts folder with a subject, HTML body, and a single To recipient.
2
addAttachment
Attach a base64-encoded file to the draft message using the fileAttachment OData type.
3
sendDraft
Send the prepared draft message. Microsoft Graph accepts the request for delivery and saves the message in Sent Items.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: Microsoft Exchange Compose, Attach, and Send Mail
  summary: Create a draft message, add a file attachment to it, then send the draft.
  description: >-
    The canonical Microsoft Graph mail composition pattern. The workflow creates
    a draft message in the signed-in user's Drafts folder, attaches a
    base64-encoded file to the draft, and then sends the completed draft so it
    lands in the Sent Items folder. Each step spells out its request inline so
    the flow can be read and executed without opening the underlying OpenAPI
    description.
  version: 1.0.0
sourceDescriptions:
- name: attachmentsApi
  url: ../openapi/microsoft-exchange-attachments-api-openapi.yml
  type: openapi
- name: messagesApi
  url: ../openapi/microsoft-exchange-messages-api-openapi.yml
  type: openapi
workflows:
- workflowId: compose-attach-send-mail
  summary: Draft a message, attach a file, and send it via Microsoft Graph.
  description: >-
    Creates a draft message with subject, body, and recipients, adds a single
    file attachment to the draft, and submits the draft for delivery.
  inputs:
    type: object
    required:
    - subject
    - bodyContent
    - toAddress
    - attachmentName
    - attachmentContentType
    - attachmentContentBytes
    properties:
      subject:
        type: string
        description: The subject line of the message.
      bodyContent:
        type: string
        description: The HTML body content of the message.
      toAddress:
        type: string
        description: The primary recipient email address.
      attachmentName:
        type: string
        description: The display name of the file attachment.
      attachmentContentType:
        type: string
        description: The MIME type of the attachment (e.g. application/pdf).
      attachmentContentBytes:
        type: string
        description: The base64-encoded contents of the attachment file.
  steps:
  - stepId: createDraft
    description: >-
      Create a draft message in the Drafts folder with a subject, HTML body,
      and a single To recipient.
    operationId: createDraftMessage
    requestBody:
      contentType: application/json
      payload:
        subject: $inputs.subject
        body:
          contentType: html
          content: $inputs.bodyContent
        toRecipients:
        - emailAddress:
            address: $inputs.toAddress
    successCriteria:
    - condition: $statusCode == 201
    outputs:
      messageId: $response.body#/id
      isDraft: $response.body#/isDraft
  - stepId: addAttachment
    description: >-
      Attach a base64-encoded file to the draft message using the
      fileAttachment OData type.
    operationId: addMessageAttachment
    parameters:
    - name: message-id
      in: path
      value: $steps.createDraft.outputs.messageId
    requestBody:
      contentType: application/json
      payload:
        '@odata.type': '#microsoft.graph.fileAttachment'
        name: $inputs.attachmentName
        contentType: $inputs.attachmentContentType
        contentBytes: $inputs.attachmentContentBytes
    successCriteria:
    - condition: $statusCode == 201
    outputs:
      attachmentId: $response.body#/id
  - stepId: sendDraft
    description: >-
      Send the prepared draft message. Microsoft Graph accepts the request for
      delivery and saves the message in Sent Items.
    operationId: sendDraftMessage
    parameters:
    - name: message-id
      in: path
      value: $steps.createDraft.outputs.messageId
    successCriteria:
    - condition: $statusCode == 202
    outputs:
      sentStatus: $statusCode
  outputs:
    messageId: $steps.createDraft.outputs.messageId
    attachmentId: $steps.addAttachment.outputs.attachmentId
    sentStatus: $steps.sendDraft.outputs.sentStatus

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-compose-attach-send-mail-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.