Skip to content

WorkflowContextScope

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

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:24

WorkflowContext | undefined


peekRunRecorder(): RunRecorder | undefined

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

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

RunRecorder | undefined


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

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

T

WorkflowContextImpl

() => Promise<T>

Promise<T>