Workflow
Defined in: packages/core/src/workflow/types.ts:225
Type Parameters
Section titled “Type Parameters”TInput
Section titled “TInput”TInput
TOutput
Section titled “TOutput”TOutput
TRawInput
Section titled “TRawInput”TRawInput = TInput
Properties
Section titled “Properties”
readonlyid:string
Defined in: packages/core/src/workflow/types.ts:226
inputSchema?
Section titled “inputSchema?”
readonlyoptionalinputSchema?:ZodType<TInput,TRawInput,$ZodTypeInternals<TInput,TRawInput>>
Defined in: packages/core/src/workflow/types.ts:228
Optional Zod schema used to validate run / stream input.
Methods
Section titled “Methods”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.
Parameters
Section titled “Parameters”TRawInput
options?
Section titled “options?”Returns
Section titled “Returns”WorkflowRunHandle<TOutput>
stream()
Section titled “stream()”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.
Parameters
Section titled “Parameters”TRawInput
Returns
Section titled “Returns”WorkflowStreamHandle<TOutput>