JavaScript Runtime

Look up every published runtime symbol and shared schema from the installed package JavaScript runtime contract on a stable static docs route.

Symbol metadata glossary

Symbol cards show kind, mutability, nullability, and binding lifecycle as glossary-backed pills when the package contract publishes those fields. The definitions below explain the published meanings — including Value versus function kind — without inventing extra enum values.
Kind
Kind classifies what the published symbol is. A Value is a bound data binding such as args or meta. A function is a callable runtime helper such as log. Namespace and method kinds appear only when the contract publishes those shapes.
Mutability
Mutability describes whether the bound object may change after bind. Mutable object means the binding exposes an object authors can update. Fixed binding means the binding identity stays fixed for the published lifetime.
Nullability
Nullability describes whether the binding may be null. Non-null means the published contract treats the binding as always present when that field is published.
Binding lifecycle
Binding lifecycle describes how the binding relates to the workflow run. Snapshot at bind captures the value when the binding is established. Live namespace stays connected to the live namespace surface for the published lifetime.

How the JavaScript runtime works

At script start the host binds Value symbols such as javascript.args and javascript.meta from the workflow request. The script body then chains published helpers — phase, log, workflow.checkpoint, agent.run, workflow.artifact, and workflow.final — to record progress, dispatch child work, attach artifacts, and terminate. The example below composes only published call patterns from the package contract.
  1. Record a phase

    Call phase with a published string label so the host can track progress before heavier work starts.

    javascript.phase

  2. Emit a log record

    Call log with a message string and an optional JSON-compatible detail object for workflow-scoped logging.

    javascript.log

  3. Persist a checkpoint

    Call workflow.checkpoint with a closed spec object (label plus optional JSON-compatible state) so a later resume can restore progress.

    javascript.workflow.checkpoint

  4. Dispatch a child agent

    Await agent.run with a closed spec that includes a required prompt and optional label and preset fields from the published agent-run schema.

    javascript.agent.run

  5. Register an artifact

    Call workflow.artifact with kind and label metadata, and optional JSON-compatible content, to attach durable output to the run.

    javascript.workflow.artifact

  6. Finish the workflow

    Call workflow.final with an optional JSON-compatible value to terminate the script and return a final result.

    javascript.workflow.final

phase("draft");
log("checkpoint", { step: 1 });
workflow.checkpoint({ label: "draft", state: { step: 1 } });
await agent.run({
  prompt: "Summarize findings",
  label: "summarize",
  preset: "operator",
});
workflow.artifact({ kind: "log", label: "step", content: { step: 1 } });
workflow.final({ ok: true, result: { count: 1 } });

Runtime Inventory

Scan the published JavaScript symbols and shared schemas below. Filter by symbol path, schema id, description, or lifecycle when those facets are present. Open a card for available metadata and shared-schema links, and copy its stable anchor when you need a deep link.

21 published JavaScript runtime items from the package contract.

Filter JavaScript runtime items

Symbols

Mutable invocation argument value bound from workflow request args JSON at script start. The binding is a non-null object snapshot; property reads and writes affect only the in-script view and do not change the original request payload.

Symbol path
args
Symbol id
javascript.args

Examples

{ "subject": "release", "count": 2, "prefix": "echo" }

Mutable invocation metadata object bound from workflow request metadata at script start. The binding is a non-null object snapshot with string-valued entries; when name is absent the runtime supplies the default simple-final label.

Symbol path
meta
Symbol id
javascript.meta

Examples

{ "name": "simple-final", "description": "Example workflow metadata" }

Synchronously emits one workflow-scoped log record. The first argument must be a non-empty string message; an optional second argument supplies JSON-compatible structured fields.

Lifecycle: ActiveActive, since 1.0.0Visibility: Public
Symbol path
log
Symbol id
javascript.log

Shared schemas

Examples

log("checkpoint", { step: 1 })

Dispatches one child agent run from a closed spec object with a required prompt and optional model or preset fields. Returns a promise that resolves to the child result object after policy checks and child_dispatch emission.

Lifecycle: ActiveActive, since 1.0.0Visibility: Public
Symbol path
agent.run
Symbol id
javascript.agent.run

Shared schemas

Examples

await agent.run({ prompt: "Summarize findings", label: "summarize", preset: "operator" })

Runs an array of agent run specs or item functions concurrently and returns a promise that resolves to an array of child results. Each function item is invoked with undefined this.

Lifecycle: ActiveActive, since 1.0.0Visibility: Public
Symbol path
parallel
Symbol id
javascript.parallel

Examples

await parallel([{ prompt: "first" }, { prompt: "second", label: "two" }])

Maps each items entry through a required worker function and optional next stage callback, running stages sequentially per item. Returns a promise that resolves to a pipeline result array.

Lifecycle: ActiveActive, since 1.0.0Visibility: Public
Symbol path
pipeline
Symbol id
javascript.pipeline

Examples

await pipeline([1, 2], (item) => item * 2, (prior, item) => prior + item)

Synchronously records one named workflow phase transition for progress tracking. The name must be a non-empty string.

Lifecycle: ActiveActive, since 1.0.0Visibility: Public
Symbol path
phase
Symbol id
javascript.phase

Examples

phase("draft")

Registers one workflow artifact with kind and label metadata. Optional content must be JSON-compatible and is subject to maxArtifactBytes policy.

Lifecycle: ActiveActive, since 1.0.0Visibility: Public
Symbol path
workflow.artifact
Symbol id
javascript.workflow.artifact

Shared schemas

Examples

workflow.artifact({ kind: "log", label: "step", content: { step: 1 } })

Terminates the workflow with an optional final value. When both workflow.final and a returned value are present, workflow.final wins for terminal result selection.

Lifecycle: ActiveActive, since 1.0.0Visibility: Public
Symbol path
workflow.final
Symbol id
javascript.workflow.final

Examples

workflow.final({ ok: true, result: { count: 1 } })

Synchronously emits one workflow-scoped log record. The first argument must be a string message; an optional second argument supplies JSON-compatible structured fields.

Lifecycle: ActiveActive, since 1.0.0Visibility: Public
Symbol path
workflow.log
Symbol id
javascript.workflow.log

Shared schemas

Examples

workflow.log("checkpoint", { step: 1 })

Shared schemas

Closed object shape for workflow.checkpoint spec arguments.

Visibility: Public

Schema

Required
label

Closed object shape for workflow.checkpoint spec arguments.

Properties
  • labelstringRequired
  • state#/sharedSchemas/javascript.schema.json_compatible/schemaOptional

Examples

{ "label": "draft", "state": {} }

Closed object shape for workflow.artifact spec arguments.

Visibility: Public

Schema

Required
kind, label

Closed object shape for workflow.artifact spec arguments.

Properties
  • kindstringRequired
  • labelstringRequired
  • content#/sharedSchemas/javascript.schema.json_compatible/schemaOptional
  • visibilitystringOptional

Examples

{ "kind": "log", "label": "step" }

Closed object shape returned by workflow.budget.

Visibility: Public

Schema

Required
maxAgents, concurrency

Closed object shape returned by workflow.budget.

Properties
  • maxAgentsnumberRequired
  • concurrencynumberRequired
  • sandboxModestringOptional
  • maxRunDurationMsnumberOptional
  • maxWorkerDurationMsnumberOptional
  • maxOutputBytesPerWorkernumberOptional
  • maxArtifactBytesnumberOptional
  • maxTokensnumberOptional

Examples

{ "maxAgents": 4, "concurrency": 2 }

Closed object shape for agent.run spec arguments.

Visibility: Public

Schema

Required
prompt

Closed object shape for agent.run spec arguments.

Properties
  • promptstringRequired
  • labelstringOptional
  • presetstringOptional
  • modelProviderstringOptional
  • modelstringOptional
  • reasoningEffortstringOptional

Examples

{ "prompt": "Summarize findings", "label": "summarize" }