Skip to content
1 min read · 224 words

Variable: createOrchestration ​

ts
const createOrchestration: CreateOrchestration;

Defined in: src/batteries/orchestration/index.ts:388

THE battery's single entry point. Everything public is reached through the Orchestration object it returns, so it is the one place a precondition can be enforced for every operation.

Construction is async because it eagerly resolves the @nhtio/encoder optional peer (throwing E_ORCH_ENCODER_REQUIRED if absent), registers the orchestration encodables once, loads every configured evaluator cell (so a missing optional peer surfaces here rather than at freeze), and validates every registered template (so a misconfigured deployment fails at boot with a named error rather than at first instantiation).

You do not need to call registerOrchestrationEncodables() yourself if you construct through this function — it runs here, before any plan can exist, so decode() can rebuild NodeRef and ParamRef from that moment on. Call it directly only when you reach the deep subpaths WITHOUT constructing an Orchestration: decoding a persisted plan in a worker that never builds one, for instance. It is idempotent, so calling it anyway is harmless.

See the module doc for the full rationale and the dependency-precedence rules.

Param ​

config

The store, tier-C allowlist, optional run-dependency defaults, and optional consumer-defined plan templates.

Returns ​

The assembled Orchestration surface.

Throws ​

if @nhtio/encoder is not installed.

Throws ​

if a configured evaluator cell's optional peer is missing.

Throws ​

if a registered template has a blocking validation issue.