Repository navigation
Conversation
Add declarative ADK Go v2 workflow agents (adk.declarative AgentSystem documents) with a registry for functions, tools, toolsets, models and node types; runnable workflow design patterns in Go and YAML; controller validation of workflow documents for BYO agents (spec.workflowFrom); session isolation for fan-out and Shared subagents; and architecture docs. Supersedes #2, rebased onto main and reconciled with runtime-level ask_user disabling. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: Dmytro Rashko <dimetron@me.com>
…d model/tool hooks - cel node type and CEL route/state_delta with ADK context (state, session, user, invocation) and cel-go standard extensions plus json.encode/decode - mcp_servers with url/header sources; tool nodes and LLM tools from remote MCP - instruction_from/global_instruction_from (env; ConfigMap/Secret via controller) - before/after model and tool callbacks with accept/reject hooks - CEL regexp classification example Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: Dmytro Rashko <dimetron@me.com>
feat(adk): declarative workflow agents for the Go ADK
dimetron
marked this pull request as draft
October 24, 2026 22:34
…atterns
- CEL retry predicate (retry.when) over error {message, timeout, canceled}
- Harness tool library: read_file, write_file, list_files, bash (opt-in)
- Close MCP sessions behind filtered toolsets; MCP, hook, prompt and CEL tests
- Declarative example runs CEL + remote MCP + harness tools end to end
- Go-vs-YAML parity patterns cel_router and mcp_tool; regenerated docs
- Controller inlines ConfigMap prompt sources, rejects Secret/env sources
- Document MCP servers, callbacks, prompt sources, retry.when, harness tools
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Dmytro Rashko <dimetron@me.com>
feat(adk): declarative CEL nodes, remote MCP tools, prompt sources and model/tool hooks
…ateway helpers
Make CEL node expressions easier to write without hiding CEL:
- vars: ordered named values read as vars.<name>, replacing nested cel.bind.
- routes: ordered {route, when} rule table; first match wins, no match takes
DEFAULT. Mutually exclusive with route.
- Helpers follow agentgateway names and semantics: json(text), toJson(value),
x.with(name, body) and default(a.b[k], fallback). json.decode/json.encode
are renamed to json/toJson.
Examples, docs and the generated pattern catalog use the new forms.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Dmytro Rashko <dimetron@me.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: Dmytro Rashko <dimetron@me.com>
feat(adk): simplify declarative CEL with vars, route rules and agentgateway helpers
As in ADK, a node without outgoing edges ends its branch. An edge to END now explains this instead of reporting an unknown node. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: Dmytro Rashko <dimetron@me.com>
dimetron
marked this pull request as ready for review
October 25, 2026 00:01
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: Dmytro Rashko <dimetron@me.com>
… subagents A cel node shared one error variable across concurrent runs, and the standalone check stopped at an isolated subagent's direct children. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: Dmytro Rashko <dimetron@me.com>
A Workflow agent may set max_concurrency to cap how many nodes of its graph run at once. workflowagent.Config takes no engine options, so a capped graph is built with workflow.WithMaxConcurrency behind a small agent that runs or resumes it. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: Dmytro Rashko <dimetron@me.com>
docs(adk): workflows have no END node; list cel routes
…s atomically retry.when replaced ADK's default predicate, so input validation errors were retried when the expression matched; they are now never retried. A DynamicFunc may run children concurrently, so DynamicEnv claims its max_iters budget atomically. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: Dmytro Rashko <dimetron@me.com>
fix(adk): keep ADK retry defaults in retry.when and count dynamic runs atomically
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR proposes declarative graph workflows for ADK Go 2.x in kagent. A workflow is a YAML/JSON
AgentSystemdocument (apiVersion: adk.declarative/v0.2) that describes ADKworkflow.Workflowgraphs andLlmAgents with no Go routing code. The controller validates it, and the Go ADK builds the equivalent ADK v2 graph at startup.The proposal has three parts:
go/adk/pkg/declarative: loader, validator and builder that map the document 1:1 onto ADK Go v2 (workflow.Start,NewFunctionNode,JoinNode,AgentNode,NamedToolNode,ParallelWorker, dynamic nodes,RequestInput, routes).AgentTemplate.spec.workflowFrom(ConfigMap key);ADKWorkflowConfigin the ADK config proto;isolation(Shared|Isolated).Document model
Node types → ADK Go 2.x
typefunctionworkflow.NewFunctionNodecelvars,output,route/routes,state_deltatoolNamedToolNodeserver:)llmLlmAgentnodeagentAgentNodejoinJoinNodeworkflowWorkflowSTART(max depth 8)parallel_workerParallelWorkermax_concurrency)dynamicmax_itershitlRequestInputEdges support routing (
route,DEFAULT) and fan-out/fan-in.timeoutandretrymap toNodeConfig;retry.whenis a CEL predicate. As in ADK,STARTis the only sentinel: a node with no outgoing edges ends its branch.CEL
input,vars,state,session,userandinvocation.json,toJson,x.with(name, body)anddefault(a.b, fallback)use the same names and semantics as agentgateway CEL.varsandroutes:vars(ordered named values) androutes(an ordered first-match rule table) replace nestedcel.bindand ternary chains.vars.<name>references, and runs under a cost limit.Callbacks / guardrails
before_model,after_model,before_toolandafter_toolare lists of rules. Each rule is either a registered Go hook or a CEL rule:when+reject: short-circuit with a message.accept: let the call through.Prompts, MCP and harness tools
instruction_from/global_instruction_fromread from a ConfigMap. The controller inlines the text and records it in revision provenance, so a ConfigMap change rolls a new revision. Secret and env sources are rejected.mcp_serversdeclares Streamable HTTP MCP servers (headers, tool filter, URL from env). Anllmnode lists a server intools:; atoolnode calls a single server tool.read_file,write_file,list_filesandbash, which work in the agent workspace.Delivery in kagent
AgentTemplate.spec.workflowFromreferences a ConfigMap key. It is mutually exclusive withsystemPrompt/systemPromptFrom, a CEL validation rule enforces this, and only a BYO Harness may use it in this first step.ADKWorkflowConfig, which is included in provenance. Invalid documents are reported as validation errors; a missing ConfigMap is retried.isolation: Isolated. In that mode the parent calls the subagent as a tool in a new session seeded with a copy of its state, which parallel fan-out to one subagent needs.Examples and docs
go/adk/examples/declarative: support triage built from CEL classification, remote MCP CRM lookup, harnesswrite_fileand an LLM node with tool hooks.go/adk/examples/workflowpatterns: 22 patterns, each implemented twice, as Go and as YAML, and tested for identical output. The catalog indocs/architecture/workflow-patterns.mdis generated from them, and a test fails if it is stale.docs/architecture/workflow-agents.md: reference for the document format.Testing
workflow_test.goandsubagent_isolation_test.go.make -C go lintis clean.Not in this PR / open questions
workflowfor now; only BYO images run documents. Should managed kagent runtimes run documents next?Related
SequentialAgent,ParallelAgent,LoopAgent) together with ADK Go 2.x graphWorkflowagents.