# Worker Configuration Options

The Hatchet worker can be configured via environment variables and programmatic options. This document contains a list of all available options.

## Basic Configuration

| Variable                                  | Description                         | Default Value           |
| ----------------------------------------- | ----------------------------------- | ----------------------- |
| `HATCHET_CLIENT_TOKEN`                    | Authentication token for the worker |                         |
| `HATCHET_CLIENT_HOST_PORT`                | GRPC server host and port           | \* Inherited from token |
| `HATCHET_CLIENT_API_URL` (TypeScript SDK) | API server host and port            | \* Inherited from token |
| `HATCHET_CLIENT_SERVER_URL` (Go SDK)      | API server host and port            | \* Inherited from token |
| `HATCHET_CLIENT_NAMESPACE`                | Namespace prefix for the worker     | \* Inherited from token |

## Worker Runtime Configuration

| Variable        | Description                                | Default Value |
| --------------- | ------------------------------------------ | ------------- |
| `name`          | Friendly name of the worker                |               |
| `slots`         | Maximum number of concurrent runs          | `100`         |
| `durable_slots` | Maximum number of concurrent durable tasks | `1000`        |

## Worker healthcheck server (Python SDK)

These variables enable a local HTTP server that exposes `/health` and `/metrics` for a running worker.

| Variable                                                               | Description                                                                                            | Default Value |
| ---------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ | ------------- |
| `HATCHET_CLIENT_WORKER_HEALTHCHECK_ENABLED`                            | Enable the local worker healthcheck server                                                             | `false`       |
| `HATCHET_CLIENT_WORKER_HEALTHCHECK_PORT`                               | Port for the local worker healthcheck server                                                           | `8001`        |
| `HATCHET_CLIENT_WORKER_HEALTHCHECK_EVENT_LOOP_BLOCK_THRESHOLD_SECONDS` | If the worker listener process event loop is blocked longer than this threshold, `/health` returns 503 | `5.0`         |

## TLS Configuration

| Variable                          | Description                    | Default Value |
| --------------------------------- | ------------------------------ | ------------- |
| `HATCHET_CLIENT_TLS_STRATEGY`     | TLS strategy (tls, mtls, none) | `tls`         |
| `HATCHET_CLIENT_TLS_CERT_FILE`    | Path to TLS certificate file   |               |
| `HATCHET_CLIENT_TLS_KEY_FILE`     | Path to TLS key file           |               |
| `HATCHET_CLIENT_TLS_ROOT_CA_FILE` | Path to TLS root CA file       |               |
| `HATCHET_CLIENT_TLS_SERVER_NAME`  | TLS server name                |               |
| `HATCHET_CLIENT_TLS_MIN_VERSION`  | Minimum TLS version (1.2, 1.3) | `1.3`         |

## Logging Configuration

| Variable                                      | Description                                         | Default Value |
| --------------------------------------------- | --------------------------------------------------- | ------------- |
| `HATCHET_CLIENT_LOG_LEVEL`                    | Log level for the worker client                     | `WARN`        |
| `HATCHET_CLIENT_LOG_FORMAT`                   | Log format for the worker client                    | `console`     |
| `HATCHET_CLIENT_GRPC_MAX_RECV_MESSAGE_LENGTH` | Maximum gRPC message receive size (Python SDK only) | `4MB`         |
| `HATCHET_CLIENT_GRPC_MAX_SEND_MESSAGE_LENGTH` | Maximum gRPC message send size (Python SDK only)    | `4MB`         |
