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.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new WorkflowContextScope():
WorkflowContextScope
Returns
Section titled “Returns”WorkflowContextScope
Methods
Section titled “Methods”peek()
Section titled “peek()”peek():
WorkflowContext|undefined
Defined in: packages/core/src/workflow/workflow-context-scope.ts:24
Returns
Section titled “Returns”WorkflowContext | undefined
peekRunRecorder()
Section titled “peekRunRecorder()”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.
Returns
Section titled “Returns”RunRecorder | undefined
run<
T>(ctx,fn):Promise<T>
Defined in: packages/core/src/workflow/workflow-context-scope.ts:20
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”WorkflowContextImpl
() => Promise<T>
Returns
Section titled “Returns”Promise<T>