Workflow
Defined in: packages/core/src/workflow/types.ts:169
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:170
inputSchema?
Section titled “inputSchema?”
readonlyoptionalinputSchema?:ZodType<TInput,TRawInput,$ZodTypeInternals<TInput,TRawInput>>
Defined in: packages/core/src/workflow/types.ts:172
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: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.
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: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.
Parameters
Section titled “Parameters”TRawInput
Returns
Section titled “Returns”WorkflowStreamHandle<TOutput>