-
Notifications
You must be signed in to change notification settings - Fork 1k
Open
Open
Copy link
Labels
epicUsed for milestone planning, please create tasks for the associated development work.Used for milestone planning, please create tasks for the associated development work.pythonv1.0Features being tracked for the version 1.0 GAFeatures being tracked for the version 1.0 GAworkflowsRelated to Workflows in agent-frameworkRelated to Workflows in agent-framework
Description
The current workflow builder makes it very easy for users and AI to mistakenly instantiate executors inline. For example,
workflow = (
WorkflowBuilder()
.add_edge(AddOneExecutor(), AddOneExecutor())
.add_edge(AddOneExecutor(), AggregateResultExecutor())
.set_start_executor(AddOneExecutor())
.build()
)This is problematic because the nodes created are never connected the way users may expect them to.
A recommended way to improve the API to prevent this from happening:
builder = WorkflowBuilder()
add_one_executor = builder.register(AddOneExecutor(), name="AddOne")
aggregate_result_executor = builder.register(AggregateResultExecutor(), name="AggregateResult")
workflow = (
builder
.add_edge(add_one_executor, add_one_executor)
.add_edge(add_one_executor, aggregate_result_executor)
.set_start_executor(add_one_executor)
.build()
)Metadata
Metadata
Assignees
Labels
epicUsed for milestone planning, please create tasks for the associated development work.Used for milestone planning, please create tasks for the associated development work.pythonv1.0Features being tracked for the version 1.0 GAFeatures being tracked for the version 1.0 GAworkflowsRelated to Workflows in agent-frameworkRelated to Workflows in agent-framework
Type
Projects
Status
In Progress