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

# Workers

> Scheduled background tasks that run autonomously.

Workers are scheduled background tasks that run autonomously on a defined schedule.

## Creating a Worker

```bash theme={null}
lukan worker add
```

This interactive wizard helps you create a worker with:

* Name and schedule
* Prompt/task description
* Tool permissions
* Provider/model selection

## Schedule Formats

| Format     | Example        | Description               |
| ---------- | -------------- | ------------------------- |
| `every:Ns` | `every:30s`    | Every N seconds (min 10s) |
| `every:Nm` | `every:5m`     | Every N minutes           |
| `every:Nh` | `every:2h`     | Every N hours             |
| Cron       | `*/10 * * * *` | Standard cron syntax      |

## Worker Definition

```json theme={null}
{
  "id": "a1b2c3",
  "name": "Check deployments",
  "schedule": "every:5m",
  "prompt": "Check if any deployments failed and notify me",
  "tools": ["Bash", "WebFetch"],
  "provider": "anthropic",
  "model": "claude-sonnet-4-5-20250929",
  "enabled": true,
  "notify": ["web", "whatsapp"]
}
```

## Notifications

Workers can send notifications via:

* `"web"` - Sends notification to web UI via WebSocket
* `"whatsapp"` - Sends notification via WhatsApp

## Managing Workers

```bash theme={null}
lukan worker list                # List all workers
lukan worker add                 # Create worker interactively
lukan worker remove <id>         # Delete a worker
lukan worker pause <id>          # Pause a worker
lukan worker resume <id>         # Resume a worker
lukan worker runs <id>           # Show recent runs
```

## Worker Daemon

Workers run through a background daemon. Manage it with:

```bash theme={null}
lukan daemon start               # Start the worker daemon
lukan daemon stop                # Stop the worker daemon
lukan daemon status              # Show daemon status
```

The daemon automatically restarts workers on configuration changes and cleans up stale runs on startup. Each worker keeps a maximum of 20 recent runs.

## Storage

* **Definitions**: `~/.config/lukan/workers.json`
* **Run history**: `~/.config/lukan/workers/<id>/<run-id>.json`
