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

# cancelPendingWorkflowExecutions

> Cancel every QUEUED and WAITING execution of a workflow. Running executions are left to finish.



**mutation** `cancelPendingWorkflowExecutions(input: CancelPendingWorkflowExecutionsInput!): CancelPendingWorkflowExecutionsOutput!`

## Arguments

**`input`**: `CancelPendingWorkflowExecutionsInput!` (required)

## Returns

`CancelPendingWorkflowExecutionsOutput!`

**`cancelledCount`**: `Int`

How many QUEUED or WAITING executions were cancelled. Zero when the workflow had none.

---

**`error`**: `MutationError`

## Examples

```graphql Mutation
mutation CancelPendingWorkflowExecutions($input: CancelPendingWorkflowExecutionsInput!) {
  cancelPendingWorkflowExecutions(input: $input) {
    cancelledCount
    error {
      message
      type
      code
      fields {
        field
        message
        type
      }
    }
  }
}
```

```json Variables
{
  "input": {
    "workflowId": "id"
  }
}
```

```json Response
{
  "data": {
    "cancelPendingWorkflowExecutions": {
      "cancelledCount": 1,
      "error": {
        "message": "string",
        "type": "VALIDATION",
        "code": "string",
        "fields": [
          {
            "field": "string",
            "message": "string",
            "type": "VALIDATION"
          }
        ]
      }
    }
  }
}
```


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