Documentation v0.42.0 all versions

JS Runtime

JavaScript workflows, activities, and webhook endpoints run on the server's JS runtime. The runtime is a server-wide choice: every JavaScript component in the process uses the same one, and components need no changes to switch between them.

Selecting the runtime

Set OBELISK_JS_RUNTIME in the environment of obelisk server run:

ValueRuntime
boa-wasm (default)Boa compiled to WASM, running in Wasmtime
v8Native V8 isolates

Any other value fails startup.

Differences

boa-wasmv8
Activity isolationA fresh WASM instance per executionA fresh V8 isolate per execution
Execution slotswasm cells of [limits]v8 cells of [limits]
Slot memory limitWASM linear memoryIsolate heap
Exceeding the memory limitFails the executionFails the execution with "JavaScript heap limit exceeded"

Workflows are deterministic on both runtimes: each restricts nondeterministic access so the same inputs and event history replay to the same result.

Execution slots

Each runtime has its own cells per workload in server.toml, so switching runtimes also switches which limits apply. The defaults are:

[limits.activities.wasm]   # boa-wasm activities, shared with Rust activities
count = 500
memory.gib = 1
[limits.activities.v8]
count = 16
memory.mib = 256
[limits.workflows.wasm]    # boa-wasm workflows, shared with Rust workflows
count = 500
memory.mib = 512
[limits.workflows.v8]
count = 100
memory.mib = 256
[limits.webhooks.wasm]     # boa-wasm webhook endpoints, shared with Rust webhook endpoints
count = 500
memory.mib = 512
[limits.webhooks.v8]
count = 16
memory.mib = 256

See Execution Slots for how slots are acquired.

V8 configuration

[v8]
thread_stack_size.mib = 4   # Stack size for each V8 isolate thread.

These settings apply only with OBELISK_JS_RUNTIME=v8. Each V8 isolate runs on its own OS thread.

On this page