Skip to content

WorkflowContextScope

Defined in: packages/core/src/workflow/workflow-context-scope.ts:18

Per-runtime AsyncLocalStorage for the active workflow context. Owned by RuntimeServices — one instance per createAdlRuntime call.

Step- or workflow-body-local binding so WorkflowContextScope#peek can resolve the current frame for agent.run and workflow tools. Not a stack: each scope sets one context for immediate children on the same async chain.

ALS is used only during step and workflow bodies — not for runtime services wiring.

new WorkflowContextScope(): WorkflowContextScope

WorkflowContextScope

peek(): WorkflowContext | undefined

Defined in: packages/core/src/workflow/workflow-context-scope.ts:25

WorkflowContext | undefined


peekRunRecorder(): RunRecorder | undefined

Defined in: packages/core/src/workflow/workflow-context-scope.ts:35

Returns the workflow’s RunRecorder when an agent runs inside a workflow/step.

RunRecorder | undefined


peekServices(): RuntimeServices | undefined

Defined in: packages/core/src/workflow/workflow-context-scope.ts:30

The active run’s services, including per-call store overrides.

RuntimeServices | undefined


run<T>(ctx, fn): Promise<T>

Defined in: packages/core/src/workflow/workflow-context-scope.ts:21

T

WorkflowContextImpl

() => Promise<T>

Promise<T>