Skip to main content

Agent.listWorkflows()

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

使用示例
Direct link to 使用示例

🌐 Usage example

await agent.listWorkflows();

参数
Direct link to 参数

🌐 Parameters

options?:

{ requestContext?: RequestContext }
= {}
Optional configuration object containing request context.

返回
Direct link to 返回

🌐 Returns

workflows:

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

扩展使用示例
Direct link to 扩展使用示例

🌐 Extended usage example

await agent.listWorkflows({
requestContext: new RequestContext(),
});

选项参数
Direct link to 选项参数

🌐 Options parameters

requestContext?:

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

🌐 Related