Skip to main content

Mastra.listWorkflows()

.listWorkflows() 方法用于检索在 Mastra 实例中已配置的所有工作流。该方法接受一个可选的选项对象。

🌐 The .listWorkflows() method is used to retrieve all workflows that have been configured in the Mastra instance. The method accepts an optional options object.

使用示例
Direct link to 使用示例

🌐 Usage example

mastra.listWorkflows();

参数
Direct link to 参数

🌐 Parameters

options:

{ serialized?: boolean }
Optional configuration object. When `serialized` is true, returns simplified workflow objects with only the name property instead of full workflow instances.

返回
Direct link to 返回

🌐 Returns

workflows:

Record<string, Workflow>
A record of all configured workflows, where keys are workflow IDs and values are workflow instances (or simplified objects if serialized is true).

🌐 Related