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

# TaskExecutor

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

`TaskExecutor` is the interface used by [`NewPollingTaskRunner`](https://docs-old.tilebox.com/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** `func() []*workflowsv1.TaskIdentifier`

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

**ExecuteTask** `func(context.Context, *workflowsv1.Task) (*workflowsv1.ExecuteTaskResponse, error)`

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


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.