Environment variables
This document provides a comprehensive reference for all environment variables currently implemented in Operion services.
Overview
Operion services are configured through environment variables. Each service (API server, worker, dispatcher) shares common configuration patterns but has service-specific requirements.
Service-Specific Configuration
Each Operion service requires specific environment variables for proper operation. All services use the run
subcommand to start.
API Server (operion-api)
Command: ./bin/operion-api
Variable | Default | Description |
---|---|---|
PORT | 9091 | Port to run the API server on |
DATABASE_URL | - | Database connection URL for persistence (required) |
EVENT_BUS_TYPE | - | Event bus type (kafka, rabbitmq, etc.) (required) |
PLUGINS_PATH | ./plugins | Path to the directory containing action plugins |
LOG_LEVEL | info | Log level (debug, info, warn, error) |
Note: The plugins-path
flag does not have an environment variable mapping in the API server.
Worker Service (operion-worker)
Command: ./bin/operion-worker
Variable | Default | Description |
---|---|---|
WORKER_ID | auto-generated | Custom worker ID (auto-generated if not provided) |
DATABASE_URL | - | Database connection URL for persistence (required) |
EVENT_BUS_TYPE | - | Event bus type (kafka, rabbitmq, etc.) (required) |
PLUGINS_PATH | ./plugins | Path to the directory containing action plugins |
LOG_LEVEL | info | Log level (debug, info, warn, error) |
Dispatcher Service (operion-dispatcher)
Command: ./bin/operion-dispatcher
Variable | Default | Description |
---|---|---|
DISPATCHER_ID | auto-generated | Custom dispatcher ID (auto-generated if not provided) |
DATABASE_URL | - | Database connection URL for persistence (required) |
EVENT_BUS_TYPE | - | Event bus type (kafka, rabbitmq, etc.) (required) |
PLUGINS_PATH | ./plugins | Path to the directory containing action plugins |
WEBHOOK_PORT | 8085 | Port for webhook HTTP server |
LOG_LEVEL | info | Log level (debug, info, warn, error) |
Database Configuration
The DATABASE_URL
environment variable supports various database formats:
# PostgreSQL
DATABASE_URL=postgresql://user:password@localhost:5432/operion?sslmode=require
# File-based persistence (JSON)
DATABASE_URL=file://./data/workflows.json
Usage Examples
Start API Server
# Using environment variables
export DATABASE_URL="postgresql://user:password@localhost:5432/operion"
export EVENT_BUS_TYPE="kafka"
export LOG_LEVEL="debug"
./bin/operion-api
# Using command-line flags
./bin/operion-api --port 8080 --database-url "postgresql://user:password@localhost:5432/operion" --event-bus "kafka" --log-level "debug"
Start Worker
# Using environment variables
export DATABASE_URL="postgresql://user:password@localhost:5432/operion"
export EVENT_BUS_TYPE="kafka"
export WORKER_ID="worker-01"
./bin/operion-worker
# Using command-line flags
./bin/operion-worker --worker-id "worker-01" --database-url "postgresql://user:password@localhost:5432/operion" --event-bus "kafka"
Start Dispatcher
# Using environment variables
export DATABASE_URL="postgresql://user:password@localhost:5432/operion"
export EVENT_BUS_TYPE="kafka"
export WEBHOOK_PORT="8085"
./bin/operion-dispatcher
# Using command-line flags
./bin/operion-dispatcher --webhook-port 8085 --database-url "postgresql://user:password@localhost:5432/operion" --event-bus "kafka"
Configuration Validation
Operion validates configuration on startup. Missing required variables will prevent the service from starting with clear error messages.
Required for all services:
DATABASE_URL
- Must be a valid database connection stringEVENT_BUS_TYPE
- Must be a supported event bus type
Next Steps
- Installation Guide - Service installation
- Docker Deployment - Container deployment
- Production Setup - Production configuration