Skip to content

[FEATURE] Implement Workflow Subagents with ADK Patterns #991

Closed as not planned
Closed as not planned

Description

@dimetron

📋 Prerequisites

📝 Feature Summary

Declarative workflow patterns (Sequential, Parallel, Loop) from ADK's workflow agents

❓ Problem Statement / Motivation

This feature adds declarative workflow patterns (Sequential, Parallel, Loop) to kagent using ADK's workflow agents. Implementation follows Test-Driven Development with parallel execution where possible.

💡 Proposed Solution

ADK Workflow Example:

Reference: https://github.com/google/adk-docs/blob/main/docs/agents/workflow-agents/loop-agents.md

# Writer Agent
apiVersion: kagent.dev/v1alpha2
kind: Agent
metadata:
  name: document-writer
  namespace: kagent
spec:
  type: Declarative
  description: "Generates or refines document drafts"
  declarative:
    systemMessage: |
      You are a skilled technical writer. 
      
      First iteration: Generate an initial draft based on the user's topic.
      Subsequent iterations: Read previous draft (temp:document_draft) and 
      feedback (temp:critique), then improve the document.
      
      Focus on:
      - Clear structure
      - Accurate technical content
      - Engaging writing style
      - Proper formatting
      
      Store your draft in output_key: "document_draft"
    modelConfig: default-model-config
    tools:
      - type: McpServer
        mcpServer:
          name: web-search-mcp
          toolNames: ["search", "get_webpage_content"]

---
# Critic Agent
apiVersion: kagent.dev/v1alpha2
kind: Agent
metadata:
  name: document-critic
  namespace: kagent
spec:
  type: Declarative
  description: "Critiques documents and suggests improvements"
  declarative:
    systemMessage: |
      You are an experienced editor and critic.
      
      Read the current draft from temp:document_draft.
      
      Evaluate:
      - Structure and organization
      - Clarity and readability
      - Technical accuracy
      - Completeness
      - Grammar and style
      
      Provide constructive criticism with specific suggestions for improvement.
      If the document is excellent (no major issues), you may recommend stopping.
      
      Store your critique in output_key: "critique"
    modelConfig: default-model-config

---
# Iterative Document Improver with Loop
apiVersion: kagent.dev/v1alpha2
kind: Agent
metadata:
  name: iterative-document-improver
  namespace: kagent
spec:
  type: Declarative
  description: "Iteratively improves documents through write-critique-refine cycles"
  declarative:
    systemMessage: |
      You orchestrate an iterative document improvement process.
      
      The workflow loops through:
      1. Writer creates/refines the document
      2. Critic evaluates and provides feedback
      
      This continues for up to 5 iterations or until the document quality is satisfactory.
      
      After the loop completes, present the final polished document to the user.
    modelConfig: default-model-config
    
    subagents:
      - role: "Iterative Document Improver"
        description: "Loop workflow for document refinement"
        delegationMode: Supervised
        workflow:
          type: Loop
          agents:
            - name: document-writer
              description: "Writes or refines document drafts"
            - name: document-critic
              description: "Critiques and suggests improvements"
            # the critic agent use exit_loop to stop the loop
          loopConfig:
            maxIterations: 5

🔄 Alternatives Considered

No response

🎯 Affected Service(s)

None

📚 Additional Context

No response

🙋 Are you willing to contribute?

  • I am willing to submit a PR for this feature

Activity

  1. added theissue type on Oct 2, 2025
  2. github-actions commented on Feb 27, 2026

    @github-actions

    This issue has been marked as stale because of no activity in the last 90 days. It will be closed in the next 90 days unless it is tagged "no stalebot" or other activity occurs.

  3. added a commit that references this issue on Apr 24, 2026
    ab30992
  4. marcellodesales commented on Oct 30, 2026

    @marcellodesales

    @dimetron I'm looking for a workflow level for Kagent/ADK agents that can work similar to https://voltagent.dev/docs/quick-start/ where a set of namespaced agents are still not enough... If I want to provide the abstraction to multiple Engineering teams that they can self-organize, users are still looking at the various Agentic design-patterns raised in the PR #3344 ... The flat structure of the namespace does feel it it is missing that workflow abstraction where it can give users the proper way to describe how a multi-agent system is structured and how those agents communication within our system... or else we are still relying on the integration layer from the gateway to have them chat via A2A with yet other tools...

    Maybe a group of us interested in similar capabilities could do something for the community?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleThis issue or PR has become stale

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions