Skip to main content
GET
/
health
curl https://your-worker.workers.dev/health
{
  "status": "healthy",
  "timestamp": 1704067200000,
  "uptime": 3600000,
  "version": "1.0.0"
}

Overview

The Health Check API provides endpoints to monitor the health and readiness of your Conductor instance, check service dependencies, and retrieve system metrics.

GET /health

Check basic system health.
details
boolean
default:"false"
Include detailed health information
timeout
number
default:"5000"
Health check timeout in milliseconds

Response

status
string
required
Health status: healthy, degraded, unhealthy
timestamp
number
required
Unix timestamp of health check
uptime
number
required
System uptime in milliseconds
version
string
required
Conductor version
services
object
Service-specific health status (when details=true)
services.database
object
services.database.status
string
Database health: up, down, degraded
services.database.latency
number
Database response time in ms
services.ai
object
services.ai.status
string
AI services health: up, down, degraded
services.ai.providers
array
Available AI provider statuses
services.storage
object
services.storage.status
string
Storage health: up, down, degraded
services.storage.types
array
Available storage types (KV, R2, D1)
curl https://your-worker.workers.dev/health
{
  "status": "healthy",
  "timestamp": 1704067200000,
  "uptime": 3600000,
  "version": "1.0.0"
}

GET /health/live

Liveness probe - check if service is running.

Response

alive
boolean
required
Always true if service responds
timestamp
number
required
Unix timestamp
curl https://your-worker.workers.dev/health/live
{
  "alive": true,
  "timestamp": 1704067200000
}

GET /health/ready

Readiness probe - check if service can handle requests. Response: 200 OK or 503 Service Unavailable
ready
boolean
required
true if ready to handle requests
timestamp
number
required
Unix timestamp
checks
object
Detailed readiness checks
checks.database
boolean
Database connectivity
checks.ai
boolean
AI services availability
checks.storage
boolean
Storage services availability
curl https://your-worker.workers.dev/health/ready
{
  "ready": true,
  "timestamp": 1704067200000,
  "checks": {
    "database": true,
    "ai": true,
    "storage": true
  }
}

GET /health/metrics

Get system performance metrics.
period
string
default:"1h"
Time period: 1m, 5m, 15m, 1h, 24h

Response

period
string
required
Time period covered by metrics
timestamp
number
required
Unix timestamp
executions
object
required
Execution metrics
executions.total
number
Total executions in period
executions.successful
number
Successful executions
executions.failed
number
Failed executions
executions.avgDuration
number
Average execution duration (ms)
members
object
Member usage statistics
members.total
number
Total member executions
members.byType
object
Executions by member type
errors
object
Error statistics
errors.total
number
Total errors
errors.byCode
object
Errors grouped by error code
resources
object
Resource usage
resources.cpu
number
CPU time used (ms)
resources.memory
number
Memory used (bytes)
curl https://your-worker.workers.dev/health/metrics
{
  "period": "1h",
  "timestamp": 1704067200000,
  "executions": {
    "total": 1250,
    "successful": 1180,
    "failed": 70,
    "avgDuration": 234
  },
  "members": {
    "total": 5420,
    "byType": {
      "Think": 2100,
      "Function": 1800,
      "Data": 980,
      "API": 540
    }
  },
  "errors": {
    "total": 70,
    "byCode": {
      "TIMEOUT": 25,
      "VALIDATION_ERROR": 30,
      "NETWORK_ERROR": 15
    }
  },
  "resources": {
    "cpu": 125000,
    "memory": 52428800
  }
}

Kubernetes Probes

Use health endpoints in Kubernetes deployments:
apiVersion: apps/v1
kind: Deployment
metadata:
  name: conductor
spec:
  template:
    spec:
      containers:
      - name: conductor
        image: conductor:latest
        livenessProbe:
          httpGet:
            path: /health/live
            port: 8080
          initialDelaySeconds: 10
          periodSeconds: 30
        readinessProbe:
          httpGet:
            path: /health/ready
            port: 8080
          initialDelaySeconds: 5
          periodSeconds: 10

Health Check Best Practices

  1. Use liveness probes - Detect when service needs restart
  2. Use readiness probes - Prevent traffic to unready instances
  3. Monitor metrics - Track performance over time
  4. Set appropriate timeouts - Balance responsiveness vs accuracy
  5. Check dependencies - Verify database, AI, storage health
  6. Use detailed checks in staging - Get full diagnostics
  7. Use basic checks in production - Minimize overhead
  8. Alert on degraded status - Catch issues early
  9. Log health events - Debug health issues
  10. Test health endpoints - Ensure probes work correctly

Error Responses

Service Unavailable

{
  "status": "unhealthy",
  "timestamp": 1704067200000,
  "error": "Database connection failed",
  "services": {
    "database": {
      "status": "down",
      "error": "Connection timeout"
    }
  }
}

Timeout

{
  "error": "Health check timeout",
  "timeout": 5000,
  "timestamp": 1704067200000
}