> For the complete documentation index, see [llms.txt](https://demystifyfp.gitbook.io/fstoolkit-errorhandling/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://demystifyfp.gitbook.io/fstoolkit-errorhandling/fstoolkit.errorhandling/option/sequencetask.md).

# sequenceTask

### Option.sequenceTask

Namespace: `FsToolkit.ErrorHandling`

Function Signature:

```fsharp
Task<'a> option -> Task<'a option>
```

Note that `sequence` is the same as `traverse id`. See also [Option.traverseTask](/fstoolkit-errorhandling/fstoolkit.errorhandling/option/traversetask.md).

See also Scott Wlaschin's [Understanding traverse and sequence](https://fsharpforfunandprofit.com/posts/elevated-world-4/).

### Examples

#### Example 1

```fsharp
let a1 : Task<int option> =
  Option.sequenceTask (Some (Task.singleton 42))
// async { return Some 42 }

let a2 : Task<int option> =
  Option.sequenceTask None
// async { return None }
```
