# DurableTask.Run(Func&lt;Task&gt;)

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

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

```csharp
public static DurableTask Run(Func<Task> function)
```

Creates an unstarted step which runs asynchronous `function` as a child execution when it is awaited, scheduled, or posted.

### Parameters

- `function` (`Func<Task>`): The asynchronous function which the child runs.

### Returns

A definition which runs the function each time it is awaited, scheduled, or posted.

### Exceptions

- `System.ArgumentNullException`: `function` is `null`.
