# ScheduledTask.CancelAsync(string?, CancellationToken)

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.durable.abstractions/orleans.durable.tasks.scheduledtask/) | [Methods](/orleans/docs/api/csharp/microsoft.orleans.durable.abstractions/orleans.durable.tasks.scheduledtask/methods/)

[Source](https://github.com/dotnet/orleans/blob/6a0e937f544c35ffcf11b37e4c2b7de5a1580a03/src/Orleans.Durable.Abstractions/ScheduledTask.cs#L188)

```csharp
public ValueTask CancelAsync(string? reason, CancellationToken cancellationToken = default(CancellationToken))
```

Durably requests cancellation carrying `reason`.

### Parameters

- `reason` (`string?`): The reason which the task's [DurableTaskContext](/orleans/docs/api/csharp/microsoft.orleans.durable.abstractions/orleans.durable.tasks.durabletaskcontext/) reports, or `null` for none.
- `cancellationToken` (`CancellationToken`): A token which abandons waiting for the request to commit.
