step
Define one durable step in an agent workflow.
SDK v2026.4.0
Kind: function
Signature
export function step<TInput, TOutput>(name: string, inputSchema: StepSchema<TInput>, outputSchema: StepSchema<TOutput>, fn: (input: TInput) => Promise<TOutput>): StepDefinition<TInput, TOutput>Remarks
Use steps to separate context gathering, decision-making, and side effects into explicit units of work.
Parameters
name: stringinputSchema: schema describing step inputoutputSchema: schema describing step outputfn: async function implementing the step