---
title: "workflows.GetCurrentCluster"
description: "Get the current cluster slug."
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.

# workflows.GetCurrentCluster

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

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

```go
workflows.GetCurrentCluster(ctx context.Context) (string, error)
```

Get the current cluster slug.

This function is intended to be used in tasks.

## Returns

The current cluster slug.

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

```go
type Task struct{}

func (t *Task) Execute(ctx context.Context) error {
	clusterSlug, err := workflows.GetCurrentCluster(ctx)
	if err != nil {
		return fmt.Errorf("failed to get current cluster: %w", err)
	}

	return nil
}
```

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