Skip to content

WorkflowContext

Defined in: packages/core/src/workflow/types.ts:34

Workflow execution scope. Implemented by WorkflowContextImpl (class); prefer ctx.step(...) on the instance — do not destructure methods off a plain object host.

Passed to the workflow author’s run function. Callers may pass WorkflowRunStartOptions.parentCtx on Workflow.run to nest under a parent run; otherwise the runtime supplies context.

apps/docs — core/runtime

readonly memoryScope: (suffix) => string

Defined in: packages/core/src/workflow/types.ts:47

string

string


readonly parentStepId: string | null

Defined in: packages/core/src/workflow/types.ts:39


step: StepFn

Defined in: packages/core/src/workflow/types.ts:45

Run a named, cacheable unit of work. Child contexts are built from the parent host (this). Agent/tool bridge uses scoped ALS only inside step bodies and the workflow body.


readonly stepId: string | null

Defined in: packages/core/src/workflow/types.ts:37


readonly stepPath: string[]

Defined in: packages/core/src/workflow/types.ts:38


readonly workflowRunId: string

Defined in: packages/core/src/workflow/types.ts:36

Id of this workflow invocation (shared by all steps/agents in the run).

emit(event): void

Defined in: packages/core/src/workflow/types.ts:53

Emit a custom run event. stepId on the persisted event is omitted at workflow root (when stepId is null).

CustomWorkflowEvent

void