> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tilebox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Collect

```go theme={"system"}
func Collect[K any](seq iter.Seq2[K, error]) ([]K, error)
```

Convert any sequence into a slice.

It returns an error if any element in the sequence has a non-nil error.

## Parameters

<ParamField path="seq" type="iter.Seq2[K, error]">
  The sequence to convert.
</ParamField>

## Returns

A slice of `K` or an error if any.

<RequestExample>
  ```go Go theme={"system"}
  jobs, err := workflows.Collect(
    client.Jobs.Query(ctx, job.WithTemporalExtent(interval)),
  )
  ```
</RequestExample>
