Microsoft Power Automate · Arazzo Workflow

Microsoft Power Automate Cancel an In-Flight Run

Version 1.0.0

Find a run that is still executing, confirm it is live, and cancel it.

1 workflow 1 source API 1 provider
View Spec View on GitHub AutomationBusiness ProcessIntegrationLow-CodeMicrosoftPower PlatformRPAWorkflowsArazzoWorkflows

Provider

microsoft-power-automate

Workflows

cancel-running-run
Cancel a flow run that is still in flight.
Scans the run history for an execution in a Running or Waiting state, re-reads it to confirm it is still live, and cancels that single run while leaving the flow itself active.
3 steps inputs: environmentName, flowName outputs: cancelledRunId, startTime, statusBeforeCancel
1
listRuns
List the flow's run history and branch on whether any execution is still in flight. A history of only terminal runs means there is nothing to cancel.
2
confirmRunStillLive
Re-read the candidate run immediately before cancelling. A long-running run can complete between the list and the cancel, and cancelling a finished run is a no-op worth avoiding.
3
cancelRun
Cancel the confirmed in-flight run. The flow stays active; only this single execution is stopped.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: Microsoft Power Automate Cancel an In-Flight Run
  summary: Find a run that is still executing, confirm it is live, and cancel it.
  description: >-
    When a flow hangs on a stuck approval or a slow downstream call, an operator
    needs to stop that specific execution without deactivating the flow itself.
    This workflow lists the run history, branches on whether an execution is
    still Running or Waiting, re-reads that run to confirm it is genuinely live
    rather than acting on stale list data, and cancels it. 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: flowRunsApi
  url: ../openapi/microsoft-power-automate-flow-runs-api-openapi.yml
  type: openapi
workflows:
- workflowId: cancel-running-run
  summary: Cancel a flow run that is still in flight.
  description: >-
    Scans the run history for an execution in a Running or Waiting state,
    re-reads it to confirm it is still live, and cancels that single run while
    leaving the flow itself active.
  inputs:
    type: object
    required:
    - environmentName
    - flowName
    properties:
      environmentName:
        type: string
        description: The name of the environment holding the flow.
      flowName:
        type: string
        description: The name or ID of the flow whose run should be cancelled.
  steps:
  - stepId: listRuns
    description: >-
      List the flow's run history and branch on whether any execution is still
      in flight. A history of only terminal runs means there is nothing to cancel.
    operationId: listFlowRuns
    parameters:
    - name: environmentName
      in: path
      value: $inputs.environmentName
    - name: flowName
      in: path
      value: $inputs.flowName
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      runs: $response.body#/value
      inFlightRunId: $response.body#/value/0/name
    onSuccess:
    - name: runInFlight
      type: goto
      stepId: confirmRunStillLive
      criteria:
      - context: $response.body
        condition: $.value[?(@.properties.status == 'Running' || @.properties.status == 'Waiting')].length > 0
        type: jsonpath
    - name: nothingInFlight
      type: end
      criteria:
      - context: $response.body
        condition: $.value[?(@.properties.status == 'Running' || @.properties.status == 'Waiting')].length == 0
        type: jsonpath
  - stepId: confirmRunStillLive
    description: >-
      Re-read the candidate run immediately before cancelling. A long-running run
      can complete between the list and the cancel, and cancelling a finished run
      is a no-op worth avoiding.
    operationId: getFlowRun
    parameters:
    - name: environmentName
      in: path
      value: $inputs.environmentName
    - name: flowName
      in: path
      value: $inputs.flowName
    - name: runId
      in: path
      value: $steps.listRuns.outputs.inFlightRunId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      runStatus: $response.body#/properties/status
      startTime: $response.body#/properties/startTime
      triggerName: $response.body#/properties/trigger/name
    onSuccess:
    - name: stillLive
      type: goto
      stepId: cancelRun
      criteria:
      - context: $response.body
        condition: $.properties.status == 'Running' || $.properties.status == 'Waiting'
        type: jsonpath
    - name: alreadyFinished
      type: end
      criteria:
      - context: $response.body
        condition: $.properties.status != 'Running' && $.properties.status != 'Waiting'
        type: jsonpath
  - stepId: cancelRun
    description: >-
      Cancel the confirmed in-flight run. The flow stays active; only this single
      execution is stopped.
    operationId: cancelFlowRun
    parameters:
    - name: environmentName
      in: path
      value: $inputs.environmentName
    - name: flowName
      in: path
      value: $inputs.flowName
    - name: runId
      in: path
      value: $steps.listRuns.outputs.inFlightRunId
    successCriteria:
    - condition: $statusCode == 200
  outputs:
    cancelledRunId: $steps.listRuns.outputs.inFlightRunId
    statusBeforeCancel: $steps.confirmRunStillLive.outputs.runStatus
    startTime: $steps.confirmRunStillLive.outputs.startTime

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-power-automate-cancel-running-run-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.