Microsoft Word · Arazzo Workflow

Microsoft Word Browse Folder and Copy Document

Version 1.0.0

List the documents in a folder and branch to copy the first item or report an empty folder.

1 workflow 1 source API 1 provider
View Spec View on GitHub DocumentsMicrosoft-365OfficeProductivityWord ProcessingArazzoWorkflows

Provider

microsoft-word

Workflows

browse-and-copy
List a folder's children and copy the first document when present.
Lists drive items in a folder and, when the folder contains at least one item, starts an asynchronous copy of the first item with a new name.
2 steps inputs: copyName, folderItemId, top outputs: copyStatus, firstItemId
1
listChildren
List the documents contained in the folder, ordered by name, and capture the first item's identifier when present.
2
copyFirst
Asynchronously copy the first document in the folder under a new name. Graph returns 202 Accepted while the copy operation runs in the background.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: Microsoft Word Browse Folder and Copy Document
  summary: List the documents in a folder and branch to copy the first item or report an empty folder.
  description: >-
    Browsing a OneDrive folder and acting on its contents with Microsoft Graph.
    The workflow lists the children of a folder, then branches: when at least one
    document is present it asynchronously copies the first item under a new name,
    and when the folder is empty it ends without copying. Every 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: driveItemsApi
  url: ../openapi/microsoft-word-drive-items-api-openapi.yml
  type: openapi
workflows:
- workflowId: browse-and-copy
  summary: List a folder's children and copy the first document when present.
  description: >-
    Lists drive items in a folder and, when the folder contains at least one
    item, starts an asynchronous copy of the first item with a new name.
  inputs:
    type: object
    required:
    - folderItemId
    - copyName
    properties:
      folderItemId:
        type: string
        description: The drive item identifier of the folder to browse.
      copyName:
        type: string
        description: The name to give the copied document.
      top:
        type: integer
        description: The maximum number of children to return.
        default: 25
  steps:
  - stepId: listChildren
    description: >-
      List the documents contained in the folder, ordered by name, and capture
      the first item's identifier when present.
    operationId: listChildren
    parameters:
    - name: item-id
      in: path
      value: $inputs.folderItemId
    - name: $top
      in: query
      value: $inputs.top
    - name: $orderby
      in: query
      value: name asc
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      firstItemId: $response.body#/value/0/id
      items: $response.body#/value
    onSuccess:
    - name: hasItems
      type: goto
      stepId: copyFirst
      criteria:
      - context: $response.body
        condition: $.value.length > 0
        type: jsonpath
    - name: emptyFolder
      type: end
      criteria:
      - context: $response.body
        condition: $.value.length == 0
        type: jsonpath
  - stepId: copyFirst
    description: >-
      Asynchronously copy the first document in the folder under a new name.
      Graph returns 202 Accepted while the copy operation runs in the background.
    operationId: copyDriveItem
    parameters:
    - name: item-id
      in: path
      value: $steps.listChildren.outputs.firstItemId
    requestBody:
      contentType: application/json
      payload:
        name: $inputs.copyName
    successCriteria:
    - condition: $statusCode == 202
    outputs:
      status: $statusCode
  outputs:
    firstItemId: $steps.listChildren.outputs.firstItemId
    copyStatus: $steps.copyFirst.outputs.status

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-word-browse-and-copy-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.