Script worker

Configure a SCRIPT_WORKER for command-backed SCRIPT_RUN dispatch: command, args, optional executorProvider, timeout/resources, and SCRIPT_RUN workstation companionship.

How To Use

Author a worker with type SCRIPT_WORKER. Put command and args on the worker; add optional executorProvider, timeout, and resources when the attempt needs an explicit wrapper or bound. Keep descriptive context in the body—the markdown body is not executed. Bind the worker from a SCRIPT_RUN workstation that supplies routing, limits, workingDirectory, worktree, env, and optional copyReferencedScripts. Script workers are not model-backed backends: they do not own model, modelProvider, modelLocality, operations, or agentTools.

Discriminator: type = SCRIPT_WORKER

SCRIPT_WORKER requires a SCRIPT_RUN workstation companion. The workstation binds the worker name and owns routing, limits, workingDirectory, worktree, env, and optional copyReferencedScripts.

Schema reference

The embed below shows the live Worker base definition with SCRIPT_WORKER overlay applicability. Selected fields are script-execution exclusive (command, args, executorProvider). Excluded fields belong to other WorkerType families and must not appear on this variant. Open the full Factory schema reference for exhaustive field lookup rather than copying contract text into this page.

Worker

object

A reusable worker definition that tells the factory how a workstation should execute work, such as through a model-backed agent or a script.

  • additionalPropertiesfalse (closed)

Fields

  • agentToolsagentToolsOptionalAgentWorkerToolsConfigExcluded

    Explicit agent-loop tool policy for AGENT_WORKER definitions. Omit or set policy DISABLED to run agent loops without advertising or executing tools.

  • argsargsOptionalarraySelected

    Additional command arguments passed to the configured command.

  • authauthOptionalHostedWorkerAuthExcluded

    Hosted-worker authentication contract. V1 hosted workers accept only auth.secretRef.

  • bodybodyOptionalstring

    Inline worker instructions or script body when the worker is authored directly in factory config.

  • commandcommandOptionalstringSelected

    Command to execute when this worker runs through a command or script provider.

  • descriptiondescriptionOptionalNameValue

    Optional localized customer-facing explanation of this worker.

  • executorProviderexecutorProviderOptionalWorkerProviderSelected

    Execution mechanism. Use `ACP` for ACP-backed workers and put the configured integration identity (for example `cursor-acp`) in modelProvider. `SCRIPT_WRAP` remains the command-wrapper compatibility value; legacy named executor identities remain accepted during migration.

  • ididOptionalstring

    Optional durable public identifier for this worker. When present, graph and layout references should use this id instead of the mutable name.

  • linearlinearOptionalHostedLinearWorkerConfigExcluded

    Provider-specific configuration for the built-in hosted LINEAR worker.

  • modelmodelOptionalstringExcluded

    Model identifier to request from the configured model provider when this worker uses model execution.

  • modelLocalitymodelLocalityOptionalWorkerModelLocalityExcluded

    Provider locality for this model capability declaration. Use `LOCAL` for embedded or host-managed inference and `CLOUD` for remote provider execution.

  • modelProvidermodelProviderOptionaloneOfExcluded

    Canonical provider identity used for model routing and provider diagnostics, or an exact invocation-parameter placeholder such as `${modelProvider}`. For `executorProvider: ACP`, this names the configured ACP integration, such as `cursor-acp`. Extension identities use lowercase standardized syntax; built-in values such as `CLAUDE` and `CODEX` remain compatibility conveniences.

  • namenameRequiredstring

    Worker name referenced by Workstation.worker.

  • operationsoperationsOptionalModelOperation[]Excluded

    Provider-agnostic model operations that this worker can execute, including named input and output slots.

  • providerproviderOptionalHostedWorkerProviderExcluded

    Built-in hosted provider identity when this worker uses repository-owned hosted execution.

  • reasoningEffortreasoningEffortOptionalReasoningEffort
  • resourcesresourcesOptionalResourceRequirement[]

    Resource capacity this worker requires before it can be dispatched.

  • skipPermissionsskipPermissionsOptionalbooleanExcluded

    When true, bypasses permission checks for providers that support permission gating.

  • stopTokenstopTokenOptionalstringExcluded

    Marker that tells model-oriented workers where to stop generated output when the provider supports it.

  • timeouttimeoutOptionalstring

    Optional Go duration that caps one worker execution attempt.

  • typetypeOptionalWorkerType

    Worker implementation family to instantiate for this definition.

Examples

Use the minimal valid example when starting a SCRIPT_WORKER. The misuse example shows model-routing fields on a script worker—model, modelProvider, and modelLocality belong on inference and agent families and fail validation on SCRIPT_WORKER.

Minimal valid SCRIPT_WORKER:

{
  "name": "go-test",
  "type": "SCRIPT_WORKER",
  "command": "go",
  "args": [
    "test",
    "./..."
  ],
  "timeout": "10m",
  "body": "Runs the Go test suite."
}

Incompatible misuse — model fields on SCRIPT_WORKER (rejected):

{
  "name": "go-test",
  "type": "SCRIPT_WORKER",
  "command": "go",
  "args": [
    "test",
    "./..."
  ],
  "model": "OMNIVOICE_Q4_K_M",
  "modelProvider": "CODEX",
  "modelLocality": "LOCAL",
  "body": "Runs the Go test suite."
}

model, modelProvider, and modelLocality are model-routing fields. Validation rejects them on SCRIPT_WORKER. Use INFERENCE_WORKER or AGENT_WORKER when you need model-backed execution.

Tags