Skip to Content
ReferenceAgentsgetWorkflows()

getWorkflows()

The .getWorkflows() method retrieves the workflows configured for an agent, resolving them if they’re a function. These workflows enable the agent to execute complex, multi-step processes with defined execution paths.

Usage example

const workflows = await agent.getWorkflows();

Parameters

options?:

{ runtimeContext?: RuntimeContext }
= {}
Optional configuration object containing runtime context.

Extended usage example

const workflows = await agent.getWorkflows({ runtimeContext: new RuntimeContext() });

Options parameters

runtimeContext?:

RuntimeContext
= new RuntimeContext()
Runtime context for dependency injection and contextual information.

Returns

workflows:

Promise<Record<string, Workflow>>
A promise that resolves to a record of workflow names to their corresponding Workflow instances.