Skip to content
providerkit
GitHub

BackgroundWorkflowOptions

Defined in: agents/src/runs.ts:91

  • Omit<BackgroundBase, "session" | "historyLimit" | "prepareHistory">
Type Parameter
I
O
optional createContinuation?: (input) => Promise<BackgroundContinuationResult>;

Defined in: agents/src/runs.ts:105

Optional durable, owner-scoped create-or-reconcile capability. Required only to cancel a suspended logical run. Also used for answers when supplied. Never substitute a local cache or an idempotency flag for atomic host storage. See BackgroundContinuationInput.

Parameter Type
input BackgroundContinuationInput

Promise<BackgroundContinuationResult>

BackgroundOptions.createContinuation


enqueue: (id) => Promise<void>;

Defined in: agents/src/runs.ts:112

Await durable queue acceptance. A worker calls runs.drive(id, background.handlers). The host must also run runs.sweep on boot and periodically, and drain on shutdown.

Parameter Type
id string

Promise<void>

BackgroundOptions.enqueue


optional events?: EventDurability;

Defined in: agents/src/runs.ts:109

Coalesced progress uses emit by default. Awaited mode needs Run.append (server 0.21+).

BackgroundOptions.events


kind: string;

Defined in: agents/src/runs.ts:99

Dedicated handler key for this agent version.

BackgroundOptions.kind


optional memory?: (owner) =>
| MemoryBinding
| Promise<MemoryBinding>;

Defined in: agents/src/runs.ts:123

Authenticate scopes in start and again in the worker. A changed erasure revision refuses resume; this factory never recalls notes or ingests a completed run automatically.

Parameter Type
owner string

| MemoryBinding | Promise<MemoryBinding>

BackgroundOptions.memory


optional onSegment?: SegmentHook;

Defined in: agents/src/runs.ts:116

Awaited before execution and after the SDK journal settles. May repeat after worker loss; the host must deduplicate/reconcile external effects. This is not host-row commit proof.

BackgroundOptions.onSegment


policy: (context) =>
| BackgroundPolicy
| Promise<BackgroundPolicy>;

Defined in: agents/src/runs.ts:113

Parameter Type
context BackgroundContext

| BackgroundPolicy | Promise<BackgroundPolicy>

BackgroundOptions.policy


runs: BackgroundRuns;

Defined in: agents/src/runs.ts:101

Injected create must resolve after its transaction commits. Only then is enqueue called.

BackgroundOptions.runs


workflow: Workflow<I, O>;

Defined in: agents/src/runs.ts:95