---
title: "Client.NewTaskRunner"
description: "Initialize a runner."
image: "https://tilebox.com/images/tilebox-docs-social-preview.png"
---

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

# Client.NewTaskRunner

import { Fragment } from "astro/jsx-runtime";

import ApiReference from "@docs/components/ApiReference.astro";

import ParamField from "@docs/components/ParamField.astro";

```go
func (*Client) NewTaskRunner(
  ctx context.Context,
  options ...runner.Option,
) (*workflows.TaskRunner, error)
```

Initialize a runner.

## Parameters

**options**

type: []runner.Option

Options for initializing the runner

## Options

**runner.WithClusterSlug(clusterSlug string)**

default: 

The [cluster](/docs/workflows/concepts/clusters#managing-clusters) to connect to. If not provided, the default cluster is used.
**runner.WithRunnerLogger(logger *slog.Logger)**

default: slog.Default()

Set the logger to use for the runner
**runner.WithDisableMetrics()**

Disable OpenTelemetry metrics for the runner

## Returns

The created runner object.

<h2 id="request-example">Usage example</h2>

```go
runner, err := client.NewTaskRunner(ctx)
```

Source: https://tilebox.com/docs/api-reference/go/workflows/NewTaskRunner/index.mdx
