Skip to content

.NET: Need for Simplified Sample Demonstrating Executor-Agent Integration in Workflows #1561

@joslat

Description

@joslat

Add Simplified sample showing basic executor-agent-executor chaining pattern in workflows

Description

developers learning the framework would benefit from an introductory example that focuses on the core concept of chaining the Executor and Agent components together.

Current State - What Exists

Samples with Executor-Agent Integration:

  1. Concurrent (Concurrent Execution)
    • What it does: Fan-out/fan-in pattern with agents
    • Workflow: StartExecutor → [Agent, Agent] → AggregationExecutor
    • Focus: Parallel processing, not sequential chaining
  2. WorkflowAsAnAgent (Agents)
    • What it does: Encapsulates a workflow containing agents as an AIAgent
    • Focus: Workflow-as-agent abstraction, and slight executor-agent integration but only for Fan-Out and Fan-In.
  3. CustomAgentExecutors (Agents)
    • What it does: Custom executors that manage agent instances internally
    • Focus: Advanced executor patterns with embedded agent management (but decouple them from being seen in the workflow, executed "ad hoc")
  4. 03_AgentsInWorkflows & 04_AgentWorkflowPatterns (Foundational)
    • What they do: Agent-only workflows using AgentWorkflowBuilder
    • Focus: Agent composition patterns (sequential, concurrent, handoffs, group chat)

The Gap - What's Missing

What's Missing in Current Samples?
The Core Gap: No sample demonstrates the fundamental pattern of sequential executor → agent → executor chaining with proper type handling and protocol management.
A foundational sample must show:

  1. The Type Mismatch Problem
    • Executors naturally work with simple types (string, int, custom objects)
    • Agents expect ChatMessage or List
    • Gap: No sample explains this fundamental incompatibility
  2. The Chat Protocol Requirements
    • Agents use ChatProtocolExecutor internally
    • They accumulate messages and require TurnToken to process
    • Gap: No sample demonstrates:
  3. The Adapter Pattern
    • Need translator executors to bridge the gap:
    • string → ChatMessage conversion
    • Send TurnToken to trigger agent
    • Extract data from ChatMessage responses
    • Gap: No sample shows WHY adapters are necessary or HOW to implement them
  4. Sequential Pipeline Pattern
    • Gap: No sample demonstrates this complete flow
  5. State Management Across Components
    • Sharing data between executors using IWorkflowContext.QueueStateUpdateAsync
    • Gap: No sample shows state coordination in mixed workflows
  6. Workflow Builder Reuse
    • Creating WorkflowBuilder once
    • Calling .Build() for each execution to ensure clean state
    • Gap: No sample demonstrates this best practice

Metadata

Metadata

Assignees

No one assigned

    Labels

    .NETsamplesIssue relates to the samples

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions