---
title: "TaskExecutor"
description: "TaskExecutor is the interface used by NewPollingTaskRunner for custom task execution backends."
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.

# TaskExecutor

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

```go
type TaskExecutor interface {
    TaskIdentifiers() []*workflowsv1.TaskIdentifier
    ExecuteTask(ctx context.Context, task *workflowsv1.Task) (*workflowsv1.ExecuteTaskResponse, error)
}
```

`TaskExecutor` is the interface used by [`NewPollingTaskRunner`](/docs/api-reference/go/workflows/NewPollingTaskRunner) for custom task execution backends.

Use this interface when you need Tilebox to poll and lease tasks, but you want another runtime to execute them.

## Methods

**TaskIdentifiers**

type: func() []*workflowsv1.TaskIdentifier

Return the task implementations the executor can currently run. This method should be cheap and non-blocking.
**ExecuteTask**

type: func(context.Context, *workflowsv1.Task) (*workflowsv1.ExecuteTaskResponse, error)

Execute a leased task and return the computed or failed task response.

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