LaufwerkLaufwerk
API reference

API reference

Every workflow-authoring primitive: imports, options, types, results, examples, and execution semantics.

Use this reference when you know what you want to build and need to know exactly what a function accepts. Start with Build a workflow for a guided introduction.

This reference describes Laufwerk 0.0.1-alpha.13, Effect 3.22.1, @effect/workflow 0.19.1, Harness 1.0.68, and the Codex/Claude Code adapters 1.0.70. Adapter options are checked against those pinned types; a newer native CLI or upstream documentation can expose options this version does not accept.

Examples are checked against an isolated, exact-version registry consumer. The framework checkout can contain changes outside this published version. See current status for release evidence.

Primitive directory

PrimitiveWhat it ownsReference
Effect SchemaRuntime input/output validation and encoded typesTypes and schemas
Workflow.makeInput/output contract and execution identityWorkflow
Activity.makeA named, recorded stepActivity
execution.agent / HarnessAgentModel adapter, instructions, tools and permissionsAgents
Session.open, Session.runAgent conversation and execution lifecycleSession
Workspace.open, Workspace.writeBackShared files and their relationship to the original sourceWorkspace
Human, HumanViewRecorded questions, typed custom forms, decisions and notificationsHuman
VisualDescriptive workflow nodes and scopesVisual annotations
createLocalExecution, createDockerExecution, createMicrosandboxWhere agents and commands executeExecution
DurableClock, DurableDeferredTimers and durable completion signalsTimers and signals
defineConfigConsumer project identity and legacy sandbox definitionsConfiguration
defineHttpRoutesHTTP entry points that can start runsHTTP
Testing and benchmarksChecks and comparisons built around recorded runsTesting and benchmarks
CLIStart, inspect, answer and control runsCLI

There is no exported Agent, Run, Task, or Benchmark constructor in the root SDK. Use execution.agent, workflow execution, and Activity.make respectively; benchmarking is currently a composition of tests and run measurements.

How to read the signatures

Effect.Effect<A, E, R> describes work that returns A, can fail with E, and requires services R. It does not execute when constructed. Inside a registered workflow's Effect.gen, use yield* to run it and obtain A.

Laufwerk supplies its session, workspace and human services and the Effect workflow engine. Calling Effect.runPromise(Session.run(...)) in an arbitrary script does not supply those services. Configuration and agent constructors, by contrast, are ordinary functions. HTTP handlers use ordinary promises.

In tables, optional means the property can be omitted. It does not imply that null is accepted. readonly properties are configuration values, not setters. Examples whose code-block titles end in .ts or .tsx are complete modules; workflow fragments are exported functions that you call from your workflow. Multi-file examples preserve their relative imports; save each file at the stated consumer path. All files on a reference page are compiled together.

Start with the complete session workflow to see workspace, agent, commands, structured output and cleanup wired together. The schema reference explains the types used in the tables.

Identity and replay

IdentityScopeExample
projectIdConsumer project"acme-tools"
Workflow name and idempotencyKey(input)Workflow execution"review" and input.requestId
Session keyRun"implementer"
ask / exec keyOperation within a continuous session"revise-2", "test-2"
Human keyRun, across all Human methods"approve-release"
Activity / clock / deferred nameNamed operation within the workflow execution"fetch-ticket"

Keep identities stable on replay and distinct for genuinely different work. In a loop, derive them from a stable iteration index. A completed operation's key is not a request to run it again with new arguments. New inputs or a benchmark trial need a new workflow execution identity.

Durability records results and resumable state. It does not make arbitrary network requests or shell commands exactly-once transactions. See reliability.

Package boundaries

ImportContents
@laufwerk/sdkSession, Workspace, Human, their public types/errors, defineConfig, ExecutionTarget
@laufwerk/executionLocal/Docker constructors, resource types, prepared Codex image helpers
@laufwerk/sdk/harnessRe-exported Harness agent API
@laufwerk/sdk/harness/codexCodex adapter, including Laufwerk's bridge compatibility correction
@laufwerk/sdk/harness/claude-codeClaude Code adapter
@laufwerk/sdk/harness/v1Low-level Harness adapter/provider protocol
@laufwerk/sdk/aiRe-export of AI SDK; useful for tool, stepCountIs and related types
@laufwerk/sdk/human-viewTyped display and response contracts
@laufwerk/sdk/visualDescriptive workflow annotations
@laufwerk/studio/reactCustom view registration and React component props
@laufwerk/sdk/httpHTTP route and workflow-start types
@laufwerk/sandboxLegacy Microsandbox integration and low-level volume helpers
@effect/workflow / effectWorkflow, Activity, timers, signals, Effect and Schema

The full upstream AI SDK and low-level provider protocols are not additional Laufwerk primitives. Their exports retain upstream contracts. The pages here document Laufwerk authoring options and the agent settings needed to use them. /internal exports are runtime implementation contracts, not a stable authoring API.

On this page