Skip to content

Workflow

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

TInput

TOutput

TRawInput = TInput

readonly id: string

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


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

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

Optional Zod schema used to validate run / stream input.

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

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

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 gets its own run id linked via parentWorkflowRunId; pass WorkflowRunStartOptions.isolated for an unlinked separate 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:244

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>