Skip to content

ADK 2.0 ignores before_run callback for Workflow #6013

@mfojtak

Description

@mfojtak

ADK 2.0 ignores before_run callback returning a value for workflows. In this case the execution should stop and no further llm calls should be executed.

Problem is in runner.py / _run_node_async where

await ic.plugin_manager.run_before_run_callback(invocation_context=ic)

swallows returned value and never checks if execution should continue

Steps to Reproduce:
Use Workflow as root_agent
Implement plugin and override before_run_callback

Expected Behavior:
Execution should stop if before_run_callback returns a value as described here:
"Returning a value to halt execution of the runner and ends the runner with that event"

Environment Details:

  • ADK Library Version (pip show google-adk): 2.2
  • Desktop OS: Linux
  • Python Version (python -V): 3.12

Model Information:

  • Are you using LiteLLM: No

How often has this issue occurred?:

  • Always (100%)

Metadata

Metadata

Assignees

Labels

v2Affects only 2.0 versionworkflow[Component] This issue is related to ADKworkflow

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions