BackgroundWorkflowOptions
Defined in: agents/src/runs.ts:91
Extends
Section titled “Extends”Omit<BackgroundBase,"session"|"historyLimit"|"prepareHistory">
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
I |
O |
Properties
Section titled “Properties”createContinuation?
Section titled “createContinuation?”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.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input |
BackgroundContinuationInput |
Returns
Section titled “Returns”Promise<BackgroundContinuationResult>
Inherited from
Section titled “Inherited from”BackgroundOptions.createContinuation
enqueue
Section titled “enqueue”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.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
id |
string |
Returns
Section titled “Returns”Promise<void>
Inherited from
Section titled “Inherited from”events?
Section titled “events?”optional events?: EventDurability;Defined in: agents/src/runs.ts:109
Coalesced progress uses emit by default. Awaited mode needs Run.append (server 0.21+).
Inherited from
Section titled “Inherited from”kind: string;Defined in: agents/src/runs.ts:99
Dedicated handler key for this agent version.
Inherited from
Section titled “Inherited from”memory?
Section titled “memory?”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.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
owner |
string |
Returns
Section titled “Returns”| MemoryBinding
| Promise<MemoryBinding>
Inherited from
Section titled “Inherited from”onSegment?
Section titled “onSegment?”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.
Inherited from
Section titled “Inherited from”policy
Section titled “policy”policy: (context) => | BackgroundPolicy| Promise<BackgroundPolicy>;Defined in: agents/src/runs.ts:113
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
context |
BackgroundContext |
Returns
Section titled “Returns”| BackgroundPolicy
| Promise<BackgroundPolicy>
Inherited from
Section titled “Inherited from”runs: BackgroundRuns;Defined in: agents/src/runs.ts:101
Injected create must resolve after its transaction commits. Only then is enqueue called.
Inherited from
Section titled “Inherited from”workflow
Section titled “workflow”workflow: Workflow<I, O>;Defined in: agents/src/runs.ts:95