Skip to main content

Agent.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

await agent.getWorkflows();

Parameters

options?:

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

Returns

workflows:

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

Extended usage example

await agent.getWorkflows({
runtimeContext: new RuntimeContext(),
});

Options parameters

runtimeContext?:

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