Microsoft Outlook · Arazzo Workflow

Microsoft Outlook Inspect and Remove Attachment

Version 1.0.0

Find a message with attachments, inspect the first one, and delete it.

1 workflow 1 source API 1 provider
View Spec View on GitHub CalendarContactsEmailEnterpriseMicrosoftOffice 365ProductivityArazzoWorkflows

Provider

microsoft-outlook

Workflows

inspect-and-remove-attachment
Locate an attachment on a message, inspect it, and remove it.
Finds the first message with attachments, lists its attachments, reads the first attachment, and deletes it.
4 steps inputs: pageSize outputs: messageId, removedAttachmentName
1
findWithAttachments
listMessages
List messages that have attachments and capture the id of the first such message.
2
listMessageAttachments
listAttachments
List the attachments on the matched message and capture the id of the first attachment.
3
inspectAttachment
getAttachment
Read the first attachment to inspect its name, size, and content type before deleting it.
4
removeAttachment
deleteAttachment
Delete the inspected attachment from the message. Graph returns 204 No Content on success.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: Microsoft Outlook Inspect and Remove Attachment
  summary: Find a message with attachments, inspect the first one, and delete it.
  description: >-
    An attachment-cleanup pattern. The workflow finds the first message that
    has attachments, lists that message's attachments, reads the first
    attachment to inspect its name and size, and then deletes it. The message
    id and attachment id chain across the steps so the flow runs without
    opening the underlying OpenAPI description.
  version: 1.0.0
sourceDescriptions:
- name: outlookMailApi
  url: ../openapi/microsoft-graph-mail-api-openapi.yml
  type: openapi
workflows:
- workflowId: inspect-and-remove-attachment
  summary: Locate an attachment on a message, inspect it, and remove it.
  description: >-
    Finds the first message with attachments, lists its attachments, reads the
    first attachment, and deletes it.
  inputs:
    type: object
    properties:
      pageSize:
        type: integer
        description: How many candidate messages to scan.
        default: 10
  steps:
  - stepId: findWithAttachments
    description: >-
      List messages that have attachments and capture the id of the first
      such message.
    operationId: listMessages
    parameters:
    - name: $filter
      in: query
      value: hasAttachments eq true
    - name: $top
      in: query
      value: $inputs.pageSize
    - name: $select
      in: query
      value: id,subject,hasAttachments
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      messageId: $response.body#/value/0/id
    onSuccess:
    - name: hasCandidate
      type: goto
      stepId: listMessageAttachments
      criteria:
      - context: $response.body
        condition: $.value.length > 0
        type: jsonpath
    - name: none
      type: end
      criteria:
      - context: $response.body
        condition: $.value.length == 0
        type: jsonpath
  - stepId: listMessageAttachments
    description: >-
      List the attachments on the matched message and capture the id of the
      first attachment.
    operationId: listAttachments
    parameters:
    - name: message-id
      in: path
      value: $steps.findWithAttachments.outputs.messageId
    - name: $select
      in: query
      value: id,name,size,contentType
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      attachmentId: $response.body#/value/0/id
  - stepId: inspectAttachment
    description: >-
      Read the first attachment to inspect its name, size, and content type
      before deleting it.
    operationId: getAttachment
    parameters:
    - name: message-id
      in: path
      value: $steps.findWithAttachments.outputs.messageId
    - name: attachment-id
      in: path
      value: $steps.listMessageAttachments.outputs.attachmentId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      name: $response.body#/name
      size: $response.body#/size
  - stepId: removeAttachment
    description: >-
      Delete the inspected attachment from the message. Graph returns 204 No
      Content on success.
    operationId: deleteAttachment
    parameters:
    - name: message-id
      in: path
      value: $steps.findWithAttachments.outputs.messageId
    - name: attachment-id
      in: path
      value: $steps.listMessageAttachments.outputs.attachmentId
    successCriteria:
    - condition: $statusCode == 204
    outputs:
      deleteStatus: $statusCode
  outputs:
    messageId: $steps.findWithAttachments.outputs.messageId
    removedAttachmentName: $steps.inspectAttachment.outputs.name

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-outlook-inspect-and-remove-attachment-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 email required.

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