Skip to main content

Komus Tasks Server

Production-grade task execution server with web UI, webhooks, scheduling, and multi-task support.

Installation

First public PyPI release: 1.0.0.

pip install ko-tasks-server

Quick Start

Start the server

ko-tasks-server takes no flags — configure it with environment variables:

export PORT=3000
export BASE_PATH=/var/lib/ko-tasks-server
export API_KEYS=your-api-key
export ADMIN_API_KEYS=your-admin-key
ko-tasks-server

Access

Endpoint Description
http://localhost:3000/ui Komus Tasks Console (default dashboard)
http://localhost:3000/ui-old Legacy htmx web dashboard
http://localhost:3000/docs OpenAPI Documentation
http://localhost:3000/health Health Check
http://localhost:3000/metrics Prometheus Metrics

Configuration

Environment Variables

Variable Default Description
PORT 3000 Server port
BASE_PATH ./data Base path for data storage
API_KEYS — Comma-separated API keys for client auth
ADMIN_API_KEYS — Comma-separated admin API keys
STORAGE_TYPE file Record/database backend: file or elasticsearch
FILE_STORAGE_TYPE local File storage backend: local or s3
LOG_LEVEL INFO Logging level

S3 Storage (optional)

export FILE_STORAGE_TYPE=s3
export S3_BUCKET=my-task-artifacts
export S3_REGION=eu-west-1
export AWS_ACCESS_KEY_ID=...
export AWS_SECRET_ACCESS_KEY=...

Elasticsearch (optional)

export STORAGE_TYPE=elasticsearch
export ELASTICSEARCH_HOSTS=http://localhost:9200

Deployment

Docker

docker build -t ko-tasks-server .
docker run -p 3000:3000 \
  -e API_KEYS=your-key \
  -e ADMIN_API_KEYS=your-admin-key \
  -v ./data:/data \
  ko-tasks-server

Docker Compose

docker-compose up -d

Pre-configured variants:

  • docker-compose.yml — Basic setup
  • docker-compose.elasticsearch.yml — With Elasticsearch
  • docker-compose.cloud.yml — Cloud-ready with S3
  • docker-compose.standalone.yml — Standalone mode

API Overview

Task Management (Admin)

# Deploy a task
curl -X POST http://localhost:3000/admin/tasks \
  -H "X-Admin-API-Key: your-admin-key" \
  -F "file=@my-task-1.0.0.zip"

# List deployed tasks
curl http://localhost:3000/admin/tasks \
  -H "X-Admin-API-Key: your-admin-key"

Thread Execution

# Create and run a thread
curl -X POST http://localhost:3000/threads \
  -H "X-API-Key: your-key" \
  -H "X-App-Id: my-app" \
  -H "X-User-Id: user-1" \
  -H "Content-Type: application/json" \
  -d '{"mode": "sync", "inputs": [{"kind": "text", "text": "Hello"}]}'

# Get thread status
curl http://localhost:3000/threads/{thread_id} \
  -H "X-API-Key: your-key"

# Pause/Resume
curl -X POST http://localhost:3000/threads/{thread_id}:pause \
  -H "X-API-Key: your-key"
curl -X POST http://localhost:3000/threads/{thread_id}:resume \
  -H "X-API-Key: your-key"

Webhooks

# Create a webhook
curl -X POST http://localhost:3000/webhooks \
  -H "X-Admin-API-Key: your-admin-key" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://hooks.example.com/task-events",
    "events": ["thread.succeeded", "thread.failed"],
    "secret": "webhook-signing-secret"
  }'

Schedules

# Create a schedule
curl -X POST http://localhost:3000/schedules \
  -H "X-Admin-API-Key: your-admin-key" \
  -H "Content-Type: application/json" \
  -d '{
    "task_id": "my-task",
    "cron": "0 8 * * MON",
    "timezone": "Europe/Paris",
    "inputs": [{"kind": "text", "text": "Weekly run"}]
  }'

Features

  • Multi-task deployment with isolated code + venv per task
  • Worker subprocess isolation with JSON Lines IPC
  • Progress, pause, resume, cancel — cooperative task control
  • Python & Node.js task runtimes
  • Web Dashboard — full CRUD for all resources
  • Webhook system — HMAC-signed, scoped, with delivery tracking
  • Cron scheduling — with concurrency policies
  • Artifact management — local or S3 storage
  • Credential vault — AES-encrypted secret storage
  • Prometheus metrics — request counts, durations, thread states
  • Idempotency — duplicate request detection

Development

# Clone and setup
git clone https://github.com/Komus-ai/ko-tasks-platform.git
cd ko-tasks-platform
uv sync

# Run server tests
uv run --package ko-tasks-server pytest packages/server/tests/ -v

# Start dev server
uv run --package ko-tasks-server python -m komus_tasks_server.server

License

MIT

Release files for ko-tasks-server 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ko-tasks-server 1.0.1
File Size Uploaded
ko_tasks_server-1.0.1.tar.gz 594.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ko-tasks-server 1.0.1
File Interpreter ABI Platform
ko_tasks_server-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 1.3 MB

Release files / ko_tasks_server-1.0.1.tar.gz

Download URL ko_tasks_server-1.0.1.tar.gz
Size 594.6 kB
Tags Source
SHA-256 checksum
How to use checksums
bfb17c8128f6a71c931115c85fb2c4c8f91fb70117b20d3a9081d24b539da575
BLAKE2b-256 checksum
How to use checksums
065aecf0c3dc97af8c4ee71e97e8a1996d0e0d38c82e04c84f6bd737e86f0792
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / ko_tasks_server-1.0.1-py3-none-any.whl

Download URL ko_tasks_server-1.0.1-py3-none-any.whl
Size 724.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d189e7665c1d4ce3d209b58ec3e96717e023f57b11a998dd27b181acc3315533
BLAKE2b-256 checksum
How to use checksums
af74e43cf27b19efeb6c9305254f31d80a5056ef45fa1b6326dfc506789e7954
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page