Skip to content

Workflow

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

TInput

TOutput

TRawInput = TInput

readonly id: string

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


readonly optional inputSchema?: ZodType<TInput, TRawInput, $ZodTypeInternals<TInput, TRawInput>>

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

Optional Zod schema used to validate run / stream input.

run(input, options?): WorkflowRunHandle<TOutput>

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

Start a workflow run. The bound runtime creates WorkflowContext internally. Use workflowRunId on the handle to subscribe before result settles. Nested run() inside another workflow joins the parent; pass WorkflowRunStartOptions.isolated for a separate persisted run. WorkflowRunHandle.cancel aborts ctx.signal, in-flight ctx.step callbacks, and child agent.run / streamText calls on the same run.

TRawInput

WorkflowRunStartOptions

WorkflowRunHandle<TOutput>


stream(input): WorkflowStreamHandle<TOutput>

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

Start a run and expose live run events (steps, agents, lifecycle) for in-process consumers. Persisted history still goes through WorkflowStore; production UI may use run + SSE instead.

TRawInput

WorkflowStreamHandle<TOutput>