Azure DevOps · Arazzo Workflow

Azure DevOps Complete a Pull Request

Version 1.0.0

Fetch a pull request, verify it can merge, and complete it.

1 workflow 1 source API 1 provider
View Spec View on GitHub AgileCI/CDDevOpsProject ManagementVersion ControlArazzoWorkflows

Provider

microsoft-azure-devops

Workflows

complete-pull-request
Verify a pull request can merge, then complete it.
Gets a pull request, and when its merge status is clean, completes it with the required source commit and completion options.
2 steps inputs: accessToken, apiVersion, deleteSourceBranch, pullRequestId, repositoryId, squashMerge outputs: closedDate, finalStatus, pullRequestId
1
getPullRequest
Fetch the pull request to read its merge status and the head commit of the source branch needed to complete it.
2
completePullRequest
Patch the pull request to status completed, supplying the required source head commit and the requested completion options.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: Azure DevOps Complete a Pull Request
  summary: Fetch a pull request, verify it can merge, and complete it.
  description: >-
    Completes (merges) an active Azure Repos pull request safely. The workflow
    fetches the pull request to read its current status and the head commit of
    the source branch, branches on whether the merge status is clean, and only
    then patches the pull request to status completed — supplying the required
    lastMergeSourceCommit and completion options such as squash merge and source
    branch deletion. 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
  x-realizes-capability-ids:
  - BC-4200.40
  x-capability-derivation:
    method: 'deterministic join: sourceDescriptions -> per-tag OpenAPI -> tag/capability edge. No classification at this step.'
    min_confidence: 0.7
    sources:
    - capability_id: BC-4200.40
      capability_name: Software Construction Management
      spec: microsoft-azure-devops-pull-requests-api-openapi.yml
      confidence: 0.9
    model: Turbo EA Capabilities by Vincent Verdet — Turbo EA, https://github.com/vincentmakes/turbo-ea-capabilities, CC BY 4.0
sourceDescriptions:
- name: pullRequestsApi
  url: ../openapi/microsoft-azure-devops-pull-requests-api-openapi.yml
  type: openapi
workflows:
- workflowId: complete-pull-request
  summary: Verify a pull request can merge, then complete it.
  description: >-
    Gets a pull request, and when its merge status is clean, completes it with
    the required source commit and completion options.
  inputs:
    type: object
    required:
    - apiVersion
    - repositoryId
    - pullRequestId
    properties:
      apiVersion:
        type: string
        description: Azure DevOps REST API version (e.g. 7.1).
      repositoryId:
        type: string
        description: Repository ID or name containing the pull request.
      pullRequestId:
        type: integer
        description: Numeric ID of the pull request to complete.
      deleteSourceBranch:
        type: boolean
        description: Whether to delete the source branch on completion.
      squashMerge:
        type: boolean
        description: Whether to squash the source commits into a single commit.
      accessToken:
        type: string
        description: Azure DevOps bearer (OAuth 2.0) access token.
  steps:
  - stepId: getPullRequest
    description: >-
      Fetch the pull request to read its merge status and the head commit of the
      source branch needed to complete it.
    operationId: pullRequests_get
    parameters:
    - name: api-version
      in: query
      value: $inputs.apiVersion
    - name: repositoryId
      in: path
      value: $inputs.repositoryId
    - name: pullRequestId
      in: path
      value: $inputs.pullRequestId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      mergeStatus: $response.body#/mergeStatus
      lastMergeSourceCommitId: $response.body#/lastMergeSourceCommit/commitId
    onSuccess:
    - name: mergeable
      type: goto
      stepId: completePullRequest
      criteria:
      - condition: $response.body#/mergeStatus == succeeded
    - name: notMergeable
      type: end
      criteria:
      - context: $response.body
        condition: $.mergeStatus != 'succeeded'
        type: jsonpath
  - stepId: completePullRequest
    description: >-
      Patch the pull request to status completed, supplying the required source
      head commit and the requested completion options.
    operationId: pullRequests_update
    parameters:
    - name: api-version
      in: query
      value: $inputs.apiVersion
    - name: repositoryId
      in: path
      value: $inputs.repositoryId
    - name: pullRequestId
      in: path
      value: $inputs.pullRequestId
    requestBody:
      contentType: application/json
      payload:
        status: completed
        lastMergeSourceCommit:
          commitId: $steps.getPullRequest.outputs.lastMergeSourceCommitId
        completionOptions:
          deleteSourceBranch: $inputs.deleteSourceBranch
          squashMerge: $inputs.squashMerge
          transitionWorkItems: true
    successCriteria:
    - condition: $statusCode == 200
    - condition: $response.body#/status == completed
    outputs:
      finalStatus: $response.body#/status
      closedDate: $response.body#/closedDate
  outputs:
    pullRequestId: $inputs.pullRequestId
    finalStatus: $steps.completePullRequest.outputs.finalStatus
    closedDate: $steps.completePullRequest.outputs.closedDate

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-azure-devops-pull-request-complete-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.