-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Scenario
Have a workflow with a starting edge that is an agent , this edge then invokes another edge that is actually a subworkflow. This subworkflow is a concurrent workflow with multiple agents set up using the AgentWorkflowBuilder.BuildConcurrent method.
Observation
When the sub workflow is set up as the output for the WithOutputFrom method, the WorkflowOutputEvent was not being fired. As a work around added another executor edge and set it to be the output in WithOutputFrom and things started working as shown below
AIAgent essayAgent = new EssayAgent(configuration).Agent; // Agent writes an essay on a topic
// Step 2: Configure the sub-workflow as an executor for use in the parent workflow . This translates the essay
ExecutorBinding subWorkflowExecutor = translatorWorkFlow.BindAsExecutor("TranslatorWorkflow"); // There are 3 agents in this concurrent workflow
PostProcessExecutor postProcessExecutor = new PostProcessExecutor(); // executor added to get it to work
var workflow = new WorkflowBuilder(essayAgent)
.AddEdge(essayAgent, subWorkflowExecutor)
.AddEdge(subWorkflowExecutor,postProcessExecutor)
.WithOutputFrom(postProcessExecutor)
.Build();
Expectation
Ideally would expect the WorkflowOutputEvent event to fire when the subworkflow as completed . Nevertheless Would like to understand the expected behavior in this case , if this is a bug or the expected behavior and we have to have a final edge added after a sub workflow invocation
Metadata
Metadata
Assignees
Labels
Type
Projects
Status