# sequenceAsync

### Option.sequenceAsync

Namespace: `FsToolkit.ErrorHandling`

Function Signature:

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

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

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

### Examples

#### Example 1

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

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://demystifyfp.gitbook.io/fstoolkit-errorhandling/fstoolkit.errorhandling/option/sequenceasync.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
