Documentation Index
Fetch the complete documentation index at: https://iii.dev/docs/llms.txt
Use this file to discover all available pages before exploring further.
How workers expand iii
Workers add capability to an iii system. Each one contributes functions and triggers the engine can route to. This page covers deploying and wiring workers into a project. For the authoring surface a worker uses to register its functions and triggers (the SDK), see each language’s Worker Docs authoring guide.Connecting to the engine
A worker connects to the engine over WebSocket. Set the engine URL via theIII_URL environment
variable, or pass it explicitly to register_worker. The connection string is the only coupling
between a worker and the iii instance it joins, so the worker process can be deployed anywhere
reachable on the network.
- Node / TypeScript
- Python
- Rust
Worker lifecycle states
Workers transition through a small set of states after connecting:connecting → connected → available / busy → disconnected. connecting is the WebSocket handshake.
connected means the Worker has joined the Engine’s registry. available and busy describe
whether the Worker is currently handling invocations. disconnected is the terminal state when the
WebSocket closes. The Engine tracks these transitions and surfaces them to other Workers and tooling
through its discovery functions, so the rest of the system can react.
Handling Worker disconnects
When a Worker’s WebSocket closes, the Engine cleans up after it automatically. Its Functions and Triggers leave the live registry, and any in-flight invocations of those Functions are cancelled. There are two things to handle on the caller side:- Catch
invocation_stopped. Callers waiting on a Function whose Worker disconnects mid-flight receive aninvocation_stoppederror rather than a timeout. Treat it like a cancellation, not a transient failure. Retrying will fail until a Worker reconnects and re-registers the Function. - Subscribe to the discovery events if you need to react to topology changes:
engine::workers-availablefires immediately when a Worker connects or disconnects.engine::functions-availableis eventually consistent; it fires on the next polling tick once the function-list hash changes.
Inspecting the live registry
To see what’s currently connected to the Engine, use one of two surfaces depending on whether you want a snapshot or a live subscription:- Read a snapshot by invoking one of the
engine::*::listFunctions:engine::workers::list: every connected Worker with metrics.engine::functions::list: every registered Function (filterable byinclude_internal).engine::triggers::list: every registered Trigger (filterable byinclude_internal).engine::trigger-types::list: every advertised Trigger type with its config and call schemas.
- Subscribe to changes by registering a Trigger against
engine::workers-available(fires when a Worker connects or disconnects) orengine::functions-available(fires when a Function is registered or unregistered). See Handling Worker disconnects for their consistency semantics.
These are the high-level call surfaces. For the wire-level shapes, see Engine
protocol.
Worker manifest
When a worker is checked into a project so iii can launch it locally,iii.worker.yaml at the
worker’s root tells iii how to install dependencies, run the worker, and pass through configuration.
iii worker add and a Worker started by hand in a container behave identically to the Engine.
For the full manifest field schema, see Using iii / Workers.
What a worker contributes
Once connected, a worker exposes:- Functions, callable by
function_idfrom anywhere in the system (see Using iii / Functions). - Triggers it advertises, which other workers can bind their functions to (see Using iii / Triggers).
Run an ephemeral worker
For one-shot jobs (Kubernetes Jobs, serverless containers, scheduled scripts), an SDK worker can connect to a remote engine, register its functions, do the work, and exit. The engine cleans up the worker’s registrations on disconnect. SetIII_URL to point the worker at the remote engine (see
Connecting to the engine), register the work the job needs to expose,
and let the process exit when the job is done.