Configuration

Every environment variable that controls the engine, plus single-node and three-node Raft setups, the X-Argyll-Raft-State header for leader-aware load balancing, and an HAProxy config you can copy.

Environment Variables

API and Webhooks

VariableDefaultDescription
API_HOST0.0.0.0HTTP listen host
API_PORT8080HTTP API port
WEBHOOK_BASE_URLhttp://localhost:8080Base URL the engine uses to construct async callback URLs. Must be reachable from your step handlers.
LOG_LEVELinfodebug, info, warn, error

Step Execution

VariableDefaultDescription
STEP_TIMEOUT30000Global HTTP step timeout fallback (ms). Overridden per step by http.timeout.

Caching

VariableDefaultDescription
MEMO_CACHE_SIZE65536In-memory memoization cache entries (LRU)
TIMEBOX_CACHE_SIZE32768Shared Timebox projection cache entries

Retry Defaults

Applied when a step omits retry fields or sets them to zero:

VariableDefaultDescription
RETRY_MAX_RETRIES10Default max retries (cannot be 0)
RETRY_INITIAL_BACKOFF1000Initial backoff in milliseconds (must be > 0)
RETRY_MAX_BACKOFF60000Backoff cap in milliseconds (must be >= RETRY_INITIAL_BACKOFF)
RETRY_BACKOFF_TYPEexponentialfixed, linear, or exponential

Invalid retry defaults fail engine startup.

Raft Storage

VariableDescription
RAFT_NODE_IDLocal node identifier
RAFT_ADDRESSLocal Raft listen address (e.g. 127.0.0.1:9701)
RAFT_DATA_DIRDurable local state directory
RAFT_SERVERSBootstrap cluster members (e.g. node1=host1:9701,node2=host2:9702)
RAFT_LOG_TAIL_SIZEHot retained WAL tail cache entries (default 20480)

Clustering

Argyll uses Raft for consensus. Run at least 3 nodes for high availability.

Single Node (development)

RAFT_NODE_ID=argyll-1
RAFT_ADDRESS=127.0.0.1:9701
RAFT_DATA_DIR=/tmp/argyll-raft/argyll-1
RAFT_SERVERS=argyll-1=127.0.0.1:9701

Three-Node Cluster

# On each node, set its own RAFT_NODE_ID and RAFT_ADDRESS,
# but the same RAFT_SERVERS listing all nodes:
RAFT_NODE_ID=argyll-1
RAFT_ADDRESS=argyll-1:9701
RAFT_DATA_DIR=/var/lib/argyll/raft/argyll-1
RAFT_SERVERS=argyll-1=argyll-1:9701,argyll-2=argyll-2:9702,argyll-3=argyll-3:9703

Writes commit on quorum. Only the Raft leader accepts writes; reads can be served from any node.

Health Check

GET /health

Returns 200. The response header X-Argyll-Raft-State contains the node’s role: leader, candidate, follower, or unknown. Use this for load balancer routing.

HAProxy Leader-Aware Routing

Route write traffic only to the Raft leader:

backend argyll_write
  option httpchk GET /health
  http-check expect hdr name "X-Argyll-Raft-State" value -m str leader
  server n1 argyll-1:8080 check
  server n2 argyll-2:8080 check
  server n3 argyll-3:8080 check

backend argyll_read
  option httpchk GET /health
  http-check expect status 200
  server n1 argyll-1:8080 check
  server n2 argyll-2:8080 check
  server n3 argyll-3:8080 check

Write paths: POST /engine/step, POST /engine/flow, /webhook/*. Read-style POSTs like POST /engine/plan and POST /engine/flow/query can go to any node.

Health Checks on Steps

HTTP steps can declare a health check endpoint:

{
  "http": {
    "endpoint": "https://api.example.com/process",
    "health_check": "https://api.example.com/health"
  }
}

The engine polls the health check to track step availability. Health checks do not block or fail step execution directly.

Security

The engine has no built-in authentication. Place it behind a reverse proxy and add auth at that layer. Network isolation or mTLS for service-to-service communication is recommended for production.

Script steps run inside the engine with restricted capabilities:

  • Ale: Purely functional, no I/O. Safe for untrusted scripts.
  • Lua: io, os, and debug modules excluded. Use only for trusted scripts.