Skip to main content
Mastra v1 is coming in January 2026. Get ahead by starting new projects with the beta or upgrade your existing project today.

Agent.listWorkflows()

The .listWorkflows() 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 exampleDirect link to Usage example

await agent.listWorkflows();

ParametersDirect link to Parameters

options?:

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

ReturnsDirect link to Returns

workflows:

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

Extended usage exampleDirect link to Extended usage example

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

Options parametersDirect link to Options parameters

runtimeContext?:

RuntimeContext
= new RuntimeContext()
Request Context for dependency injection and contextual information.

On this page