WorkflowDefinition
WorkflowDefinition<
TInput,TOutput,TRawInput> =object
Defined in: packages/core/src/workflow/types.ts:96
TInput is the parsed schema output (defaults applied). TRawInput is what
Workflow.run / Workflow.stream accept before parse.
Pin types with Zod (inputSchema / outputSchema) or with explicit generics and no
runtime schema:
type In = { topic: string };type Out = { papers: string[] };adl.createWorkflow<In, Out>({ id: "search", run: async (input, ctx) => ({ papers: [] }),});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”id:
string
Defined in: packages/core/src/workflow/types.ts:97
inputSchema?
Section titled “inputSchema?”
optionalinputSchema?:z.ZodType<TInput,TRawInput>
Defined in: packages/core/src/workflow/types.ts:99
Optional Zod schema. Omit when TInput is pinned by generics or run annotations.
outputSchema?
Section titled “outputSchema?”
optionaloutputSchema?:z.ZodType<TOutput>
Defined in: packages/core/src/workflow/types.ts:101
Optional Zod schema. Omit when TOutput is pinned by generics or run’s return type.
run: (
input,ctx) =>Promise<TOutput>
Defined in: packages/core/src/workflow/types.ts:103
Author implementation — receives parsed input and ctx from the runtime.
Parameters
Section titled “Parameters”TInput
Returns
Section titled “Returns”Promise<TOutput>