# cancelWorkflow

Audience: Developer

**Served by:** [workflow](https://docs.pyck.cloud/api/services/workflow.md)

## Arguments

| Name | Type |
| --- | --- |
| `input` | [CancelWorkflowInput](https://docs.pyck.cloud/api/inputs/cancelworkflowinput.md)! |

## Returns

[CancelWorkflowPayload](https://docs.pyck.cloud/api/types/cancelworkflowpayload.md)!

## Example

Requests graceful cancellation of a running workflow execution. The target workflow receives a cancellation signal on its context and can run cleanup before terminating. Returns once the cancel request has been accepted by Temporal (not when the workflow has actually terminated).

```graphql
mutation CancelWorkflow($input: CancelWorkflowInput!) {
  cancelWorkflow(input: $input) {
    workflowID
    workflowRunID
  }
}
```

**Variables**

```json
{
  "input": {
    "workflowID": "<workflow execution ID>",
    "workflowRunID": "<run ID>"
  }
}
```
