Defaults reference

Canonical reference for default values across the Resonate server and SDKs (TypeScript, Python, Rust).

This page is the single source of truth for default values across the Resonate server and SDKs. Every value below is sourced from a specific file and line in the canonical source repositories; if a default changes in source, this page is wrong until it is updated.

If you only want to know "what does ctx.run retry by default?" — see ctx.run / per-call options and Retry policies.


Server defaults#

The Resonate server is a Rust binary. Its source lives at resonatehq/resonate; every default below is sourced from src/config.rs. The CLI flag name is the kebab-case path through the config struct (e.g. tasks.lease_timeout--tasks-lease-timeout); the equivalent environment variable uses double-underscore nesting (e.g. RESONATE_TASKS__LEASE_TIMEOUT). Loading order: built-in defaults → optional resonate.toml → env vars.

HTTP server#

SettingDefaultSource
--server-host"localhost"resonate/src/config.rs:99
--server-port8001resonate/src/config.rs:102
--server-bind"0.0.0.0"resonate/src/config.rs:105
--server-shutdown-timeout10000 msresonate/src/config.rs:108
--server-urlunset (falls back to http://{host}:{port} in response headers)resonate/src/config.rs:91
--server-cors-allow-originsempty (CORS disabled)resonate/src/config.rs:67
--level"info"resonate/src/config.rs:60

Storage#

SettingDefaultSource
--storage-type"sqlite"resonate/src/config.rs:148
--storage-sqlite-path"resonate.db"resonate/src/config.rs:159
--storage-postgres-urlunsetresonate/src/config.rs:174
--storage-postgres-pool-size10resonate/src/config.rs:182
--storage-mysql-urlunsetresonate/src/config.rs:197
--storage-mysql-pool-size10resonate/src/config.rs:182 (shared default_pool_size)

Tasks + background scans#

SettingDefaultSource
--tasks-lease-timeout15000 msresonate/src/config.rs:250
--tasks-retry-timeout30000 msresonate/src/config.rs:253 — most deployments should lower this to 500 ms; see the tip on Run a server
--timeouts-poll-interval1000 msresonate/src/config.rs:273
--messages-poll-interval100 msresonate/src/config.rs:296
--messages-batch-size100resonate/src/config.rs:299

Transports#

SettingDefaultSource
--transports-http-push-enabledtrueresonate/src/config.rs:399
--transports-http-push-concurrency16resonate/src/config.rs:387
--transports-http-push-connect-timeout10000 msresonate/src/config.rs:390
--transports-http-push-request-timeout180000 msresonate/src/config.rs:393
--transports-http-push-auth-mode"none"resonate/src/config.rs:462 (HttpPushAuthMode::None)
--transports-http-push-auth-header"Authorization"resonate/src/config.rs:442
--transports-http-poll-enabledtrueresonate/src/config.rs:494
--transports-http-poll-max-connections1000resonate/src/config.rs:485
--transports-http-poll-buffer-size100resonate/src/config.rs:488
--transports-gcps-enabledfalseresonate/src/config.rs:351
--transports-bash-exec-enabledfalseresonate/src/config.rs:342

Observability#

SettingDefaultSource
--observability-metrics-port9090 (set to 0 to disable)resonate/src/config.rs:513
--observability-otlp-endpoint"localhost:4317"resonate/src/config.rs:516

SDK init defaults#

The SDK init defaults are the values you get from calling new Resonate() (TypeScript), Resonate() (Python), or Resonate::local() / Resonate::new(ResonateConfig::default()) (Rust) with no arguments.

TypeScript#

OptionDefaultSource
urlresolved from RESONATE_URL env, otherwise local in-memory networkresonate-sdk-ts/src/resonate.ts:147
group"default"resonate-sdk-ts/src/resonate.ts:103
pidrandom UUIDresonate-sdk-ts/src/resonate.ts:149
ttl1 * util.MIN = 60,000 msresonate-sdk-ts/src/resonate.ts:105 (constant at src/util.ts:25)
verbosefalseresonate-sdk-ts/src/resonate.ts:108
logLevel"warn" (fallback when verbose=false)resonate-sdk-ts/src/resonate.ts:137
prefixresolved from RESONATE_PREFIX, else emptyresonate-sdk-ts/src/resonate.ts:132
HTTP request timeout (HttpNetwork)RESONATE_TIMEOUT env var if set, else 10 * util.SEC = 10,000 msresonate-sdk-ts/src/network/http.ts:60-62
HTTP URL fallback"http://localhost:8001"resonate-sdk-ts/src/network/http.ts:58

There is no workers / concurrency parameter in the TypeScript SDK — task execution runs on the Node/Bun event loop with no SDK-side cap.

See TypeScript SDK Defaults for surface-scoped framing.

Python#

OptionDefaultSource
urlresolved from RESONATE_URL, else RESONATE_HOST + RESONATE_PORT, else localresonate-sdk-py/resonate/resonate.py:173-181
group"default"resonate-sdk-py/resonate/resonate.py:99
piduuid.uuid4().hexresonate-sdk-py/resonate/resonate.py:161
ttl10 (seconds)resonate-sdk-py/resonate/resonate.py:101
log_levellogging.INFOresonate-sdk-py/resonate/resonate.py:102
workersmin(32, workers or (os.cpu_count() or 1))resonate-sdk-py/resonate/processor.py:16
RESONATE_SCHEME fallback"http"resonate-sdk-py/resonate/resonate.py:179
RESONATE_PORT fallback"8001"resonate-sdk-py/resonate/resonate.py:180
Python ttl is in seconds; TypeScript ttl is in milliseconds

Python ttl=10 is 10 seconds. TypeScript ttl=60000 is 60 seconds. They are not identical defaults in either value or unit.

See Python SDK Defaults for surface-scoped framing.

Rust#

OptionDefaultSource
urlresolved from RESONATE_URL, else RESONATE_HOST/RESONATE_SCHEME/RESONATE_PORTresonate-sdk-rs/resonate/src/resonate.rs:164-171
RESONATE_SCHEME fallback"http"resonate-sdk-rs/resonate/src/resonate.rs:168
RESONATE_PORT fallback"8001"resonate-sdk-rs/resonate/src/resonate.rs:169
group"default" (in local_with)resonate-sdk-rs/resonate/src/resonate.rs:121
pid"default" (in local_with); from network in remote moderesonate-sdk-rs/resonate/src/resonate.rs:120,191
ttl60_000 ms (remote) / u64::MAX (local)resonate-sdk-rs/resonate/src/resonate.rs:151,127
prefixresolved from RESONATE_PREFIX, else emptyresonate-sdk-rs/resonate/src/resonate.rs:154-156

The Rust SDK has no workers parameter — function execution runs on the user-supplied Tokio runtime.

See Rust SDK Defaults for surface-scoped framing.


ctx.run / per-call options#

These are the defaults applied to a single ctx.run(...), ctx.rpc(...), or top-level resonate.run(...) call when no per-call options are passed.

TypeScript#

The TypeScript Options class sets the following defaults in its constructor:

FieldDefaultSource
idundefined (auto-generated by the runtime)resonate-sdk-ts/src/options.ts:48
retryPolicyundefined at the options layer; resolved to new Exponential() for regular functions, new Never() for generator functions when ctx.run / ctx.rpc executesresonate-sdk-ts/src/options.ts:49, resolution at resonate-sdk-ts/src/context.ts:397,432
tags{}resonate-sdk-ts/src/options.ts:50
target"default"resonate-sdk-ts/src/options.ts:51
timeout24 * util.HOUR = 86,400,000 ms (24 h)resonate-sdk-ts/src/options.ts:52 (constants at src/util.ts:24-26)
version0resonate-sdk-ts/src/options.ts:53
nonRetryableErrors[]resonate-sdk-ts/src/options.ts:54

So the practical answer to "what is the default retry behaviour of ctx.run in the TypeScript SDK?" is: Exponential() with its own defaults (see below) for regular async functions, and Never() for generator functions.

See TypeScript SDK Defaults for surface-scoped framing.

Python#

The Python Options dataclass:

FieldDefaultSource
durableTrueresonate-sdk-py/resonate/options.py:18
encoderNoneresonate-sdk-py/resonate/options.py:19
idNone (auto-generated)resonate-sdk-py/resonate/options.py:20
idempotency_keylambda id: id (identity)resonate-sdk-py/resonate/options.py:21
non_retryable_exceptions()resonate-sdk-py/resonate/options.py:22
retry_policylambda f: Never() if isgeneratorfunction(f) else Exponential()resonate-sdk-py/resonate/options.py:23
target"default"resonate-sdk-py/resonate/options.py:24
tags{}resonate-sdk-py/resonate/options.py:25
timeout31_536_000 = 1 year, in secondsresonate-sdk-py/resonate/options.py:26
version0resonate-sdk-py/resonate/options.py:27

See Python SDK Defaults for surface-scoped framing.

Rust#

The Rust Options struct currently exposes only structural fields:

FieldDefaultSource
tagsHashMap::new() (empty)resonate-sdk-rs/resonate/src/options.rs:20
target"default"resonate-sdk-rs/resonate/src/options.rs:21
timeoutDuration::from_secs(86_400) = 24 hresonate-sdk-rs/resonate/src/options.rs:22
version0resonate-sdk-rs/resonate/src/options.rs:23
Rust SDK has no per-call retry policy yet

The Rust SDK Options struct does not carry a retry_policy field — retry behaviour is governed by the server's task-retry contract, not by a per-invocation policy. This is a known asymmetry with the TypeScript and Python SDKs and is tracked separately.

See Rust SDK Defaults for surface-scoped framing.


Retry policies#

Retry policies are constructible by users and supplied via the per-call options. The four built-in policies share the same shape across TypeScript and Python with one important difference: TypeScript times are in milliseconds, Python times are in seconds.

Exponential#

ParameterTypeScript defaultPython default
delay1000 (ms) — resonate-sdk-ts/src/retries.ts:531 (sec) — resonate-sdk-py/resonate/retry_policies/exponential.py:11
factor2resonate-sdk-ts/src/retries.ts:542resonate-sdk-py/resonate/retry_policies/exponential.py:13
maxRetries / max_retriesNumber.MAX_SAFE_INTEGERresonate-sdk-ts/src/retries.ts:55sys.maxsizeresonate-sdk-py/resonate/retry_policies/exponential.py:12
maxDelay / max_delay30000 (ms) — resonate-sdk-ts/src/retries.ts:5630 (sec) — resonate-sdk-py/resonate/retry_policies/exponential.py:14

Both SDKs use the formula min(delay * factor^attempt, maxDelay) for the n-th retry, with attempt 0 returning 0.

Constant#

ParameterTypeScript defaultPython default
delay1000 (ms) — resonate-sdk-ts/src/retries.ts:161 (sec) — resonate-sdk-py/resonate/retry_policies/constant.py:11
maxRetries / max_retriesNumber.MAX_SAFE_INTEGERresonate-sdk-ts/src/retries.ts:16sys.maxsizeresonate-sdk-py/resonate/retry_policies/constant.py:12

Linear#

ParameterTypeScript defaultPython default
delay1000 (ms) — resonate-sdk-ts/src/retries.ts:931 (sec) — resonate-sdk-py/resonate/retry_policies/linear.py:11
maxRetries / max_retriesNumber.MAX_SAFE_INTEGERresonate-sdk-ts/src/retries.ts:93sys.maxsizeresonate-sdk-py/resonate/retry_policies/linear.py:12

The n-th retry delay is delay * attempt in both SDKs.

Never#

Never takes no parameters in either SDK. It returns 0 on attempt 0 and null / None for all later attempts.

  • TypeScript — resonate-sdk-ts/src/retries.ts:118-135
  • Python — resonate-sdk-py/resonate/retry_policies/never.py

Rust#

The Rust SDK does not yet ship Exponential / Constant / Linear / Never retry-policy types — there is no per-invocation retry policy on the Rust Options struct (see the callout above). Retry behaviour for Rust workers is determined server-side via --tasks-retry-timeout.


Cross-SDK parity#

ConceptTypeScriptPythonRust
Init group"default""default""default"
Init ttl60_000 ms10 sec60_000 ms (remote) / u64::MAX (local)
Init time unitmillisecondssecondsmilliseconds (ttl) / Duration (timeout)
Per-call timeout24 h1 year24 h
Per-call target"default""default""default"
Per-call tags{}{}empty HashMap
Per-call version000
Default retry policy (regular fn)Exponential()Exponential()not configurable per-call
Default retry policy (generator fn)Never()Never()n/a
Retry-policy time unitmillisecondssecondsn/a
Exponential maxDelay30_000 ms30 secn/a
Concurrency capnonemin(32, workers or os.cpu_count() or 1)none (Tokio runtime)

Asymmetries to call out:

  • Per-call timeout. TypeScript and Rust default to 24 h; Python defaults to 1 year. Same field, very different envelope.
  • ttl. TypeScript and Rust use milliseconds; Python uses seconds. Same name, different unit.
  • Retry-policy time units. TypeScript retry policies are configured in milliseconds; Python retry policies are configured in seconds. The behaviour curve is identical; the numbers are not.
  • Per-call retry policy. Available in TypeScript and Python; not yet on the Rust Options struct. Rust retries are governed by the server's --tasks-retry-timeout flag.
  • Worker concurrency cap. Only Python imposes one (min(32, ...)). TypeScript and Rust lean on the host event-loop / runtime.

Environment variables#

The SDKs share a common set of RESONATE_* environment variables. Defaults below are the fallbacks applied when both the constructor argument and the env var are unset.

Env varDefaultSources
RESONATE_URLunset → local in-memory modeTS: resonate-sdk-ts/src/resonate.ts:147; Py: resonate-sdk-py/resonate/resonate.py:175; Rs: resonate-sdk-rs/resonate/src/resonate.rs:165
RESONATE_HOSTunsetTS: not consumed; Py: resonate-sdk-py/resonate/resonate.py:177; Rs: resonate-sdk-rs/resonate/src/resonate.rs:167
RESONATE_SCHEME"http"Py: resonate-sdk-py/resonate/resonate.py:179; Rs: resonate-sdk-rs/resonate/src/resonate.rs:168
RESONATE_PORT"8001"Py: resonate-sdk-py/resonate/resonate.py:180; Rs: resonate-sdk-rs/resonate/src/resonate.rs:169
RESONATE_TOKENunsetTS: resonate-sdk-ts/src/network/http.ts:67; Py: resonate-sdk-py/resonate/resonate.py:184; Rs: resonate-sdk-rs/resonate/src/resonate.rs:175
RESONATE_USERNAMEunset (Python only)Py: resonate-sdk-py/resonate/resonate.py:187
RESONATE_PASSWORD"" (Python only)Py: resonate-sdk-py/resonate/resonate.py:189
RESONATE_PREFIXunset → empty prefixTS: resonate-sdk-ts/src/resonate.ts:132; Rs: resonate-sdk-rs/resonate/src/resonate.rs:155
RESONATE_TIMEOUT10000 ms (TS HTTP only)TS: resonate-sdk-ts/src/network/http.ts:60-62
RESONATE_URL HTTP fallback"http://localhost:8001" (TS HttpNetwork constructor)resonate-sdk-ts/src/network/http.ts:58

Server-side RESONATE_* environment variables (storage, auth, transports) follow the RESONATE_<SECTION>__<FIELD> convention. See Run a server › Environment variables for the complete list — those defaults track the server flag table above.