# ConfiguredDurableTask Methods

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.durable.abstractions/orleans.durable.tasks.configureddurabletask/)

## Detached {#detached-dc1093ab}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.durable.abstractions/orleans.durable.tasks.configureddurabletask/methods/detached-dc1093ab/)

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

```csharp
public ConfiguredDurableTask Detached()
```

Returns a configuration which starts the task as an independent root task.

## Detached(string) {#detached-string-187146b9}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.durable.abstractions/orleans.durable.tasks.configureddurabletask/methods/detached-string-187146b9/)

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

```csharp
public ConfiguredDurableTask Detached(string rootId)
```

Returns a configuration which starts the task as the independent root task `rootId`.

### Parameters

- `rootId` (`string`): The definition to start, such as a durable grain call.

### Exceptions

- `System.InvalidOperationException`: This configuration already has an identifier.
- `System.ArgumentException`: `rootId` is `null` or empty.

## GetAwaiter {#getawaiter-e4b5e5a3}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.durable.abstractions/orleans.durable.tasks.configureddurabletask/methods/getawaiter-e4b5e5a3/)

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

```csharp
public DurableTaskAwaiter GetAwaiter()
```

Gets an awaiter which runs or attaches to the task and returns once its result is durable.

## Post {#post-46739e17}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.durable.abstractions/orleans.durable.tasks.configureddurabletask/methods/post-46739e17/)

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

```csharp
public ScheduledTask Post()
```

Stages the start of the task in the caller's durable outbox, and returns its handle without waiting.

### Returns

The task's handle, which the caller can await later.

### Exceptions

- `System.InvalidOperationException`: The caller has no durable outbox, for example because it's a client.

## ScheduleAsync(CancellationToken) {#scheduleasync-system-threading-cancellationtoken-a84caa6c}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.durable.abstractions/orleans.durable.tasks.configureddurabletask/methods/scheduleasync-system-threading-cancellationtoken-a84caa6c/)

[Source](https://github.com/dotnet/orleans/blob/6a0e937f544c35ffcf11b37e4c2b7de5a1580a03/src/Orleans.Durable.Abstractions/DurableTask.cs#L643-L647)

```csharp
public Task<ScheduledTask> ScheduleAsync(CancellationToken cancellationToken = default(CancellationToken))
```

Starts the task and returns its handle once the task's host has accepted and durably stored the task.

### Parameters

- `cancellationToken` (`CancellationToken`): A token which abandons the start. It doesn't cancel the task.

### Returns

The task's handle, whose [ScheduledTask](/orleans/docs/api/csharp/microsoft.orleans.durable.abstractions/orleans.durable.tasks.scheduledtask/) addresses the task.

## Shielded {#shielded-25152b6d}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.durable.abstractions/orleans.durable.tasks.configureddurabletask/methods/shielded-25152b6d/)

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

```csharp
public ConfiguredDurableTask Shielded()
```

Returns a configuration which starts the task as an attached child, or runs it as part of the execution, out of reach of the starting execution's durable cancellation.

## WithId(string) {#withid-string-e8a48b16}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.durable.abstractions/orleans.durable.tasks.configureddurabletask/methods/withid-string-e8a48b16/)

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

```csharp
public ConfiguredDurableTask WithId(string name)
```

Returns a configuration which names the task.

### Parameters

- `name` (`string`): The definition to start.

### Exceptions

- `System.InvalidOperationException`: This configuration already has an identifier.
