> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mobilerun.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Abort a running or pending execution

> Signals the worker to stop the execution between steps and marks it cancelled. Idempotent-ish: already-terminal executions return 409.



## OpenAPI

````yaml /api-reference/workflows.yaml post /executions/{executionId}/abort
openapi: 3.1.0
info:
  title: Workflows
  version: v1
servers:
  - description: Droidrun Cloud API
    url: https://api.mobilerun.ai/v1
security:
  - bearerAuth: []
paths:
  /executions/{executionId}/abort:
    post:
      tags:
        - Executions
      summary: Abort a running or pending execution
      description: >-
        Signals the worker to stop the execution between steps and marks it
        cancelled. Idempotent-ish: already-terminal executions return 409.
      operationId: abortExecution
      parameters:
        - in: path
          name: executionId
          required: true
          schema:
            format: uuid
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  data:
                    $ref: '#/components/schemas/FlowExecution'
                required:
                  - data
                type: object
          description: Execution aborted
        '404':
          content:
            application/json:
              schema:
                properties:
                  error:
                    type: string
                required:
                  - error
                type: object
          description: Not Found
        '409':
          description: Conflict
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Mobilerun from '@mobilerun/sdk';


            const client = new Mobilerun({
              apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
            });


            const response = await
            client.workflows.executions.abort('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');


            console.log(response.data);
        - lang: Python
          source: |-
            import os
            from mobilerun_sdk import Mobilerun

            client = Mobilerun(
                api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"),  # This is the default and can be omitted
            )
            response = client.workflows.executions.abort(
                "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
            print(response.data)
components:
  schemas:
    FlowExecution:
      properties:
        deviceId:
          description: >-
            Device this execution targets (the job's deviceId). Null for
            device-less (event-only) runs.
          format: uuid
          type:
            - string
            - 'null'
        error:
          type:
            - string
            - 'null'
        eventId:
          format: uuid
          type:
            - string
            - 'null'
        finishedAt:
          type:
            - string
            - 'null'
        flowId:
          format: uuid
          type: string
        flowName:
          type:
            - string
            - 'null'
        id:
          format: uuid
          type: string
        invocationId:
          description: >-
            Client/verify invocation key this row belongs to. Set on live custom
            fires (one row per device fan-out) and on verification runs; null
            for event/schedule live rows.
          format: uuid
          type:
            - string
            - 'null'
        kind:
          enum:
            - live
            - dry_run
            - verification
          type: string
        recordingDeviceId:
          format: uuid
          type:
            - string
            - 'null'
        recordingId:
          description: >-
            Device-recording id (devices-api) for this execution, set once the
            worker starts a recording. Null when the flow has recording
            disabled, no device is bound, or the recording failed to start.
          format: uuid
          type:
            - string
            - 'null'
        result:
          description: >-
            Opaque per-step result blob ({ steps: [...] }). Each step
            additionally carries a `verdict` field ({ outcome, summary, reason?
            } | null) when it is an agent.run step that opted into a verdict —
            null otherwise. Table-backed steps (current executions) also carry a
            `status` string (e.g. success/failed/stopped, see deriveStepStatus);
            it is optional and absent on legacy blob-only executions, so clients
            must not assume its presence.
        startedAt:
          type:
            - string
            - 'null'
        status:
          enum:
            - pending
            - running
            - success
            - failed
            - cancelled
            - skipped
            - invalid
          type:
            - string
            - 'null'
        triggerId:
          format: uuid
          type: string
        triggerName:
          type:
            - string
            - 'null'
      required:
        - id
        - flowId
        - triggerId
        - eventId
        - invocationId
        - deviceId
        - flowName
        - triggerName
        - status
        - kind
        - error
        - recordingId
        - recordingDeviceId
        - startedAt
        - finishedAt
      type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: Opaque
      description: Bearer token via Authorization header
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.