Skip to main content
Signature:
Both RunOptions and RunResult are defined in Types.

Launch attribution

Pass optional self-reported launch provenance with startedBy; it is persisted in the run config and is distinct from auth.triggeredBy and annotations.
harness and sessionId are trimmed and limited to 64/256 Unicode code points. prompt is explicit-only and is clipped with at 8,192 code points. Attribution is immutable when resuming an existing run and carries to continue-as-new child runs. Do not infer it from workflow input or use it for authentication.

Concurrency

When opts.maxConcurrency is omitted, a run starts with a cap of 4 concurrent tasks that Smithers can raise as work queues up to the positive-integer SMITHERS_AUTO_MAX_CONCURRENCY_CEILING environment setting (16 by default); a wider declared <Parallel maxConcurrency> or subtreeConcurrency also raises an unpinned run’s initial cap, unconstrained by that ceiling. Providing opts.maxConcurrency explicitly pins the cap: it disables automatic raises, including declared-width raises, so the run can’t exceed the supplied value, even though that value can itself be larger than the automatic ceiling. Lifecycle-linked child workflows (<Subflow> / executeChildWorkflow) draw from the parent’s run cap as well as any enclosing subtreeConcurrency cap, including through nested child runs. The awaiting parent task yields its slot while the child runs, so maxConcurrency: 1 remains deadlock-free. A run that only supplies parentRunId is detached lineage and keeps an independent cap.

Resume

Pass the original runId plus resume: true: state loads from the configured durable store, completed tasks are skipped, and in-progress attempts older than 15 minutes are abandoned and retried.
The original input row is loaded from durable state, so pass {} for input; the workflow file hash and VCS root must match the original run.

Cancel via AbortSignal

All in-flight attempts are marked cancelled and NodeCancelled events are emitted.

Hijack handoff

If a CLI hijack happens mid-run (bunx smthrs hijack RUN_ID), the run ends "cancelled" and the latest attempt metadata stores hijackHandoff; on resume: true, Smithers waits for a safe handoff point and continues with the persisted CLI session id (see CLI Agents) or message history (SDK agents).

result.output

Populated only when the schema passed to createSmithers() has a key literally named output. Inside a workflow, consume other typed rows through ctx.output, ctx.latest, or ctx.outputs; outside it, expose the run through the workspace Gateway and fetch a node’s typed output through getNodeOutput:
Controllers and monitors must not open SQLite/PGlite/Postgres or query output and _smithers_* tables directly: the Gateway preserves auth, ownership, invalidation, event emission, and backend independence. Direct storage access stays reserved for runtime implementation, migration, backend tests, and maintainer diagnostics.

Notes

  • On macOS, runWorkflow acquires a caffeinate lock to prevent idle sleep and releases it on completion; elsewhere this is a no-op.
  • Set SMITHERS_LOG_LEVEL=debug to enable verbose engine logging.
  • For lifecycle events, pass onProgress (see Events).