Skip to content

.NET : Subworkflow Output behavior #2163

@jmurkothintel

Description

@jmurkothintel

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

.NETv1.0Features being tracked for the version 1.0 GAworkflowsRelated to Workflows in agent-framework

Type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions