Configuration

Set WAYMARK_DATABASE_URL to connect Waymark to Postgres. The other variables have defaults for a single-host deployment; change them when your workload or network setup requires it.

Configuration is entirely through environment variables. The runtime reads them directly from the process environment - there's no auto-loading of .env files, so set them before launching waymark-executor (or load the file with your language's tooling, such as python-dotenv in Python, if that's your preference).

The variables are grouped by which process reads them: waymark-executor, the bridge, and the Python SDK / boot helpers. Durations are in milliseconds unless the name says otherwise.

Node

These are the variables you'll touch most often when running waymark-executor, the node.

VariableDescriptionDefault
WAYMARK_DATABASE_URLPostgreSQL DSN for runtime state.Required
WAYMARK_DATABASE_MAX_CONNECTIONSConnection cap for the main database pool.25
WAYMARK_WORKER_COUNTNumber of worker processes.The CPUs available to the node, container CPU limits included
WAYMARK_CONCURRENT_PER_WORKERMax concurrent actions per worker.10
WAYMARK_MAX_CONCURRENT_INSTANCESMax workflow instances held concurrently, per node.500
WAYMARK_USER_MODULEComma-separated Python modules each worker imports at startup.Unset
WAYMARK_MAX_ACTION_LIFECYCLEActions per worker before recycle (memory mitigation).Unset (no limit)
WAYMARK_HTTP_ENABLEDServe the HTTP API and the webapp.false
WAYMARK_HTTP_ADDRHTTP server bind address. The HTTP API has no authentication: keep it private with the bind address or the network in front of it.0.0.0.0:24119
METRICS_ADDRBind address of the Prometheus metrics endpoint. It is always on and has no authentication. Note the missing WAYMARK_ prefix.0.0.0.0:9118
RUST_LOGLog filter for the node's output, in tracing target syntax (e.g. info,waymark_vm_driver=debug). An unparsable value falls back to the default with a warning.info

Node advanced

These settings control worker connections, database timeouts, migrations, leases, and polling. Start with the defaults and adjust them for a measured bottleneck or a specific deployment requirement.

Every *_STATEMENT_TIMEOUT_MS is sent with each connection and overrides statement_timeout on the role, database, or DSN. A pooler such as PgBouncer must pass those startup options through; otherwise the role or database setting applies.

VariableDescriptionDefault
WAYMARK_WORKER_GRPC_ADDRgRPC bind for the worker bridge server.127.0.0.1:24118
WAYMARK_DATABASE_STATEMENT_TIMEOUT_MSHow long one statement on the main database pool may run. 0 turns the limit off.60000
WAYMARK_DATABASE_ACQUIRE_TIMEOUT_MSHow long taking a connection from the main database pool may wait before it fails. 0 refuses to boot.30000
WAYMARK_MIGRATIONS_DATABASE_URLDSN the main database's migrations run through, on a connection of their own at startup. Use it to give the migrations a role that can create and alter the schema, while WAYMARK_DATABASE_URL keeps a role that only reads and writes. The migrations role owns what it creates, so before the first boot run ALTER DEFAULT PRIVILEGES FOR ROLE <migrations role> to grant the other role USAGE on schemas and SELECT, INSERT, UPDATE, DELETE on tables; every table the migrations create, the observability store's included while it shares this database, then comes with these rights, now and in later upgrades. After the first boot, revoke all but SELECT on public._sqlx_migrations and observability._sqlx_migrations, which the bridge only reads.WAYMARK_DATABASE_URL
WAYMARK_MIGRATIONS_STATEMENT_TIMEOUT_MSHow long one statement on the main database's migrations connection may run. 0 turns the limit off.600000
WAYMARK_LOCK_TTL_MSWorkload pinning lease TTL: how long a node's claim on a workflow instance lasts before it must be refreshed.15000
WAYMARK_LOCK_HEARTBEAT_MSWorkload pinning lease heartbeat interval.5000
WAYMARK_PINNING_FENCING_MARGIN_MSHow much earlier than the lease TTL a node stops an instance whose lease it could not re-confirm, so the instance has stopped before another node can take it.1000
WAYMARK_WORKLOAD_POLL_INTERVAL_NSMinimum interval between polls for unclaimed workflow instances, in nanoseconds. Polling spins by design; this only floors how tight it gets.1000000 (1 ms)
WAYMARK_ACTION_EFFECT_RECONCILER_LOCK_TTL_MSHow long a node's lock on an action call request lasts before it must be renewed.15000
WAYMARK_ACTION_EFFECT_RECONCILER_LOCK_HEARTBEAT_MSHow often the node renews the action call request locks it holds, and how often a workflow's node checks for action calls whose locks lapsed, to fail them with ActionExecutionLost.5000
WAYMARK_SLEEP_POLL_INTERVAL_MSHow often the node polls for durable sleeps that are due, while any are pending.250
WAYMARK_SCHEDULER_POLL_INTERVAL_MSHow often the node polls for due schedules.1000
WAYMARK_SCHEDULER_BATCH_MAXMax due schedules started per poll.64

Write batching

The node coalesces its hot-path writes into batched statements. Each writer flushes when its batch is full or when the oldest item in it has waited for the delay, whichever comes first.

VariableDescriptionDefault
WAYMARK_SNAPSHOT_BATCH_MAXMax VM snapshots per batched write.256
WAYMARK_SNAPSHOT_BATCH_DELAY_MSLongest a snapshot waits before its batch is flushed.5
WAYMARK_ACTION_EFFECT_RECONCILER_REQUEST_BATCH_MAXMax action call requests per batched insert.256
WAYMARK_ACTION_EFFECT_RECONCILER_REQUEST_BATCH_DELAY_MSLongest an action call request waits before its batch is flushed.5
WAYMARK_WORKFLOW_COMPLETION_BATCH_MAXMax workflow outcomes per batched write.256
WAYMARK_WORKFLOW_COMPLETION_BATCH_DELAY_MSLongest a workflow outcome waits before its batch is flushed.5
WAYMARK_ACTION_EFFECT_RECONCILER_LOCK_BATCH_MAXMax action call request lock statements per batched statement.256
WAYMARK_ACTION_EFFECT_RECONCILER_LOCK_BATCH_DELAY_MSLongest a lock statement waits before its batch is flushed.5

In-memory caches

These bound what a node keeps in its own memory. They don't delete anything from the database.

VariableDescriptionDefault
WAYMARK_VM_RETENTION_MSHow long a node keeps a VM's state in memory after the VM is evicted.60000
WAYMARK_VM_SWEEP_INTERVAL_MSHow often expired VM states are swept from memory.10000
WAYMARK_EXECUTABLE_RETENTION_MSHow long a compiled workflow is kept in memory after its last use.300000
WAYMARK_EXECUTABLE_SWEEP_INTERVAL_MSHow often expired compiled workflows are swept from memory.60000

Observability

The observability store holds workflow events for the webapp's Workflows view and node load samples for its Fleet view. When connected to a database, the bridge also records workflow registrations there.

The store has its own schema and connection pools even when it shares the main database. The observability API uses a separate read pool.

VariableDescriptionDefault
WAYMARK_OBSERVABILITY_DATABASE_URLDSN for the observability store; the backend is picked by the URL scheme.WAYMARK_DATABASE_URL
WAYMARK_OBSERVABILITY_READ_DATABASE_URLDSN the observability API reads through: the same database, or a read replica of it. It must name the same backend as the observability DSN; another backend refuses to boot.WAYMARK_OBSERVABILITY_DATABASE_URL
WAYMARK_OBSERVABILITY_MIGRATIONS_DATABASE_URLDSN the observability store's migrations run through, on a connection of their own at startup. Use it to give the migrations a role that can create and alter the schema, while the observability DSN keeps a role that only reads and writes. The migrations role owns what it creates, so before the first boot run ALTER DEFAULT PRIVILEGES FOR ROLE <migrations role> to grant the observability DSN's role USAGE on schemas and SELECT, INSERT, UPDATE, DELETE on tables, and the read DSN's role USAGE on schemas and SELECT on tables; every table the migrations create, now and in later upgrades, then comes with these rights. After the first boot, revoke all but SELECT on observability._sqlx_migrations, which the bridge only reads. It must name the same backend as the observability DSN; another backend refuses to boot.WAYMARK_OBSERVABILITY_DATABASE_URL when set, else WAYMARK_MIGRATIONS_DATABASE_URL
WAYMARK_OBSERVABILITY_POSTGRES_MAX_CONNECTIONSConnection cap for the observability write pool, additive to the main pool's when sharing the database.4
WAYMARK_OBSERVABILITY_POSTGRES_READ_MAX_CONNECTIONSConnection cap for the observability read pool, additive likewise.4
WAYMARK_OBSERVABILITY_POSTGRES_STATEMENT_TIMEOUT_MSHow long one statement on the write pool may run; the sinks' flushes and retention sweeps run there. 0 turns the limit off.30000
WAYMARK_OBSERVABILITY_POSTGRES_MIGRATIONS_STATEMENT_TIMEOUT_MSHow long one statement on the migrations connection may run. 0 turns the limit off.600000
WAYMARK_OBSERVABILITY_POSTGRES_READ_STATEMENT_TIMEOUT_MSHow long one statement on the read pool may run. 0 turns the limit off.10000
WAYMARK_OBSERVABILITY_POSTGRES_ACQUIRE_TIMEOUT_MSHow long taking a connection from the write pool may wait before it fails. 0 refuses to boot.30000
WAYMARK_OBSERVABILITY_POSTGRES_READ_ACQUIRE_TIMEOUT_MSHow long taking a connection from the read pool may wait before it fails. 0 refuses to boot.30000

Both kinds of data are kept for seven days by default. A retention sweep deletes anything older; nothing else in the observability store expires.

VariableDescriptionDefault
WAYMARK_OBSERVABILITY_EVENTS_RETENTION_MSHow long observability events, and the state derived from them, are kept.604800000 (7 days)
WAYMARK_OBSERVABILITY_EVENTS_RETENTION_SWEEP_INTERVAL_MSHow often the events retention sweep runs.600000
WAYMARK_OBSERVABILITY_EVENTS_RECORD_SNAPSHOT_PERSISTEDRecord a snapshot_persisted event per persisted VM snapshot.false
WAYMARK_ESSENTIAL_METRICS_SAMPLE_INTERVAL_MSHow often each node samples its own load.10000
WAYMARK_ESSENTIAL_METRICS_RETENTION_MSHow long node samples are kept.604800000 (7 days)
WAYMARK_ESSENTIAL_METRICS_RETENTION_SWEEP_INTERVAL_MSHow often the samples retention sweep runs.600000

Events and samples use separate buffered writers, called sinks. Each sink fills one buffer while others wait or are written. It swaps out the buffer when full or when the oldest item reaches the maximum delay.

Failed writes are counted and dropped, not retried. Configure at least two buffers and no more than one fewer flusher than buffers.

VariableDescriptionDefault
WAYMARK_OBSERVABILITY_EVENTS_SINK_BUFFERSEvent buffers per node.3
WAYMARK_OBSERVABILITY_EVENTS_SINK_MAX_BATCHEvents per buffer.256
WAYMARK_OBSERVABILITY_EVENTS_SINK_MAX_DELAY_MSLongest an event waits before its buffer is swapped out.1000
WAYMARK_OBSERVABILITY_EVENTS_SINK_FLUSHERSEvent buffers written concurrently.1
WAYMARK_ESSENTIAL_METRICS_SINK_BUFFERSSample buffers per node.3
WAYMARK_ESSENTIAL_METRICS_SINK_MAX_BATCHSamples per buffer.64
WAYMARK_ESSENTIAL_METRICS_SINK_MAX_DELAY_MSLongest a sample waits before its buffer is swapped out.5000
WAYMARK_ESSENTIAL_METRICS_SINK_FLUSHERSSample buffers written concurrently.1

Bridge

waymark-bridge connects your app to the Rust runtime over gRPC and serves the SDKs for all supported languages. The SDK starts the bridge; in Python, it starts a singleton on the first workflow invocation. You can also run it as a separate service, such as a sidecar container. The settings below apply in either case.

The bridge needs a database the nodes have migrated and a role that can read and write rows. Put shared configuration overrides in both the app's and the nodes' environments. The bridge reads the same WAYMARK_DATABASE_* variables as the node, but some defaults differ. When they share an environment, an explicit value applies to both processes.

With a database, the bridge records registered executables through its own write pool to the observability store. It checks both schemas at startup and never migrates either one. The nodes must have migrated both to the exact version the bridge expects.

For a separate observability store, set WAYMARK_OBSERVABILITY_DATABASE_URL on every host that starts a bridge. Without it, the bridge looks for the store in the main database and refuses to start.

The bridge validates every WAYMARK_OBSERVABILITY_EVENTS_* variable the node reads, but only the SINK_* settings take effect. Its observability settings use the same defaults as the node.

VariableDescriptionDefault
WAYMARK_BRIDGE_GRPC_ADDRgRPC bind address.127.0.0.1:24117
WAYMARK_BRIDGE_IN_MEMORYRun with no Postgres backend (test / dev only). Any value but empty, 0, false or no (trimmed, in any case) turns it on. When a workflow's run() is called under pytest, the Python SDK sets it to 1 unless it is already set.false
WAYMARK_DATABASE_URLPostgreSQL DSN.Required unless in-memory
WAYMARK_DATABASE_MAX_CONNECTIONSConnection cap for the bridge's database pool.10
WAYMARK_DATABASE_STATEMENT_TIMEOUT_MSHow long one statement on the bridge's database pool may run. 0 turns the limit off.60000
WAYMARK_DATABASE_ACQUIRE_TIMEOUT_MSHow long taking a connection from the bridge's database pool may wait before it fails. 0 refuses to boot.30000
WAYMARK_MIGRATIONS_STATEMENT_TIMEOUT_MSHow long the bridge waits at startup for a migration in progress, on a connection of its own. 0 turns the limit off.600000
WAYMARK_OBSERVABILITY_DATABASE_URLDSN for the observability store.WAYMARK_DATABASE_URL
WAYMARK_OBSERVABILITY_POSTGRES_MAX_CONNECTIONSConnection cap for the bridge's observability write pool, additive to its database pool's when sharing the database.4
WAYMARK_OBSERVABILITY_POSTGRES_STATEMENT_TIMEOUT_MSHow long one statement on the bridge's observability write pool may run. 0 turns the limit off.30000
WAYMARK_OBSERVABILITY_POSTGRES_ACQUIRE_TIMEOUT_MSHow long taking a connection from the bridge's observability write pool may wait before it fails. 0 refuses to boot.30000
WAYMARK_OBSERVABILITY_POSTGRES_MIGRATIONS_STATEMENT_TIMEOUT_MSHow long the bridge waits at startup for an observability migration in progress, on a connection of its own. 0 turns the limit off.600000
WAYMARK_OBSERVABILITY_EVENTS_SINK_BUFFERS / _MAX_BATCH / _MAX_DELAY_MS / _FLUSHERSThe bridge's event sink, as for the node's.3 / 256 / 1000 / 1
RUST_LOGLog filter, as for the node.info

Python SDK & bootstrap

These influence how the Python SDK finds a bridge - useful when you've split processes across containers or hosts. With none of them set, the SDK runs waymark-boot-singleton, which looks for a running bridge on the base port and the nine ports after it and starts one if there is none.

VariableDescriptionDefault
WAYMARK_BRIDGE_GRPC_ADDRExplicit host:port for the SDK to connect to. The boot helper still runs unless WAYMARK_BRIDGE_GRPC_PORT is set too.Unset
WAYMARK_BRIDGE_GRPC_HOSTBridge gRPC host, for the SDK and the boot helper; ignored when WAYMARK_BRIDGE_GRPC_ADDR is set.127.0.0.1
WAYMARK_BRIDGE_GRPC_PORTFor the SDK: connect to this port without booting anything. For the boot helper: the base port it probes from.24117 (boot helper)
WAYMARK_BRIDGE_BASE_PORTFallback for WAYMARK_BRIDGE_GRPC_PORT, read only by the boot helper; ignored when WAYMARK_BRIDGE_GRPC_ADDR is set.Unset
WAYMARK_BOOT_COMMANDFull command the SDK runs to boot the singleton bridge.Unset
WAYMARK_BOOT_BINARYBoot binary used when WAYMARK_BOOT_COMMAND is unset.waymark-boot-singleton
WAYMARK_SKIP_WAIT_FOR_INSTANCEReturn immediately after queueing instead of awaiting completion.false
WAYMARK_LOG_LEVELPython SDK logger level.INFO

Building from source

The webapp is compiled into waymark-executor at build time. This only matters when you build the binaries yourself; the published wheels always include it.

VariableDescriptionDefault
WAYMARK_BUILD_WEBAPP_ENABLErequired fails the build when the webapp does not build; best-effort embeds a placeholder page instead; disabled always embeds the placeholder.required when CI=true, else best-effort

Worker recycling

WAYMARK_MAX_ACTION_LIFECYCLE controls how many actions a worker can execute before it's automatically replaced. Useful when a third-party library leaks memory: set the variable to something like 1000 or 10000 and Waymark will spin up a fresh worker before retiring the old one. Today the old worker is stopped with its in-flight actions, which fail with ActionExecutionLost (#727); a retry policy that lists it retries them.

By default this is unset, meaning workers run indefinitely.