Operations

Configuration Priority & Environments


Configuration Priority

The orchestrator applies settings in this precedence order:

  1. CLI flags (highest priority)
  2. Environment variables
  3. Config file (TOML, via --config or ORCHER_ORCHESTRATOR_CONFIG)
  4. Built-in defaults (lowest priority)

This means you can set base configuration in a file, override specific values with environment variables (useful for secrets like DATABASE_URL), and further override with CLI flags for testing.


Development vs Production

Development Defaults

The orchestrator uses more aggressive timeouts in debug builds:

SettingDevelopmentProduction
claim_timeout_secs60 (1 min)300 (5 min)
reclaim_interval_secs510
poll_timeout_secs3060
log_formatcompactjson

Or use OrchestratorConfig::for_development() programmatically for shorter timeouts and aggressive reclaim intervals.

Minimal Production Configuration

The minimum required for production:

1
DATABASE_URL="postgresql://orcher:PASSWORD@pgbouncer:6432/orcher?sslmode=require" \
2
REDIS_URL="redis://redis:6379" \
3
LOG_FORMAT=json \
4
./orchestrator

Everything else uses sensible defaults. Add a TOML config file only when you need to tune polling, timeouts, retry, or security settings.

Full Production Example

1
[server]
2
grpc_addr = "0.0.0.0:50051"
3
http_addr = "0.0.0.0:8001"
4
max_concurrent_streams = 1000
5
6
[orchestrator]
7
max_workers = 100
8
max_concurrent_tasks = 1000
9
heartbeat_timeout_secs = 90
10
11
[storage]
12
database_url = "postgresql://orcher:PASSWORD@pgbouncer:6432/orcher?sslmode=require"
13
redis_url = "redis://redis:6379"
14
15
[logging]
16
level = "info"
17
format = "json"
18
19
[health]
20
readiness_enabled = true
21
liveness_enabled = true
22
23
[polling]
24
claim_timeout_secs = 300
25
claim_query_timeout_ms = 2000
26
poll_timeout_secs = 60
27
reclaim_interval_secs = 10
28
enable_notifications = true
29
batch_claim_size = 10
30
31
[timeout_watcher]
32
enabled = true
33
poll_interval_secs = 30
34
batch_size = 100
35
grace_period_secs = 5
36
37
[workflow_retry]
38
enabled = true
39
default_max_attempts = 3
40
default_initial_backoff_secs = 1
41
default_backoff_multiplier = 2.0
42
default_max_backoff_secs = 300
43
44
[background_jobs]
45
metrics_enabled = true
46
metrics_interval_secs = 3600
47
retention_enabled = true
48
retention_interval_secs = 86400
49
50
[background_jobs.retention_days]
51
workflow_executions = 90
52
execution_logs = 30
53
journal_entries = 90
54
task_executions = 90
55
outbox_queue = 7
56
57
[security]
58
auth_mode = "api-key"
59
api_key_cache_ttl_secs = 300
60
api_key_cache_max_entries = 10000

Next Steps