Add a new sample 'auth_oauth' demonstrating how to request a GitHub OAuth token in a workflow and use it to list repositories. Also rename the 'auth_config' sample to 'auth_api_key' for consistency.
Change-Id: I014b2f46f74b3017be89efc092380087179cf533
Add alias_generator and populate_by_name to RequestInput model_config to match frontend naming conventions and other event models.
Change-Id: I5eb4a55185d0113d86407c119050bb9885a7962b
Moved the stateful aggregation logic from JoinNode to the Workflow orchestrator to simplify node implementation and prevent state leaks in loops. Removed in_nodes from Context as it is no longer needed.
Change-Id: If0677f65c735ee3bce985478f7990b4a3335b7df
Sort keys when saving rebuilt JSON test files and re-assign sequential event IDs to avoid gaps from filtered events. Also applied these changes to all existing test files in the contributing folder.
Change-Id: Ib126228f016db1d28030eee4f7d9d8cbc604e038
Only add branch segments when parallelism occurs. Handle joins by using the common prefix of incoming branches.
Change-Id: If75f57e2dd69f2ddf71ade818e9c19d2a6e32c53
Demonstrates dynamic node orchestration with ctx.run_node() and asyncio.gather. Uses sub_branch for event isolation to prevent context pollution.
Change-Id: I00b98fe135b5f2a4d671580054d3aa4ad2901d50
- Removed obsolete TODOs and mode='single_turn' from dynamic nodes sample.
- Fixed line lengths exceeding 80 characters in several samples.
- Removed unused imports and arguments.
Change-Id: Ie03871a258d02eadae9f2ae73f6d2982b755eae5
Running all tests caused the global random state to diverge, failing samples that rely on specific random sequences (like retry and loop_self). Moving mock values to JSON files allows deterministic replay without hardcoding sample paths in the runner.
Change-Id: I8e8b14cc54baa47da96aecdbaacb391868d528bb
This commit refactors the workflow engine's retry mechanics to use a 1-based `attempt_count` instead of the ambiguous `retry_count`. This eliminates off-by-one complexities and aligns the implementation with documented behavior.
Key Changes:
- Replaced `retry_count` with `attempt_count` across `_node_runner_class.py`, `_node_runner.py`, `_workflow.py`, and `_retry_utils.py`.
- Updated `Context` in `agents/context.py` to use `attempt_count` as primary, removing `retry_count` entirely.
- Updated `NodeState` in `_node_state.py` to store `attempt_count` (1-based) instead of `retry_count`.
- Fixed the off-by-one bug in `max_attempts` check: now simply `attempt_count >= max_attempts`.
- Updated the `retry` sample and its README to use `attempt_count` and `max_attempts`.
- Updated unit tests in `test_node_runner_class_failure.py` and `test_workflow_failures.py` to use `attempt_count` and `attempt_counts` in assertions.
Change-Id: I0809c345cae2b62a00170e45e5c3cb6b648823f1
Allow users to customize test execution by passing arbitrary arguments to the underlying pytest runner. Ensure test results are reproducible by removing non-deterministic fields and enforcing sequential execution IDs during test rebuilding.
Change-Id: Ib08dc6a39c6ddf5dff6735865892b02c7d12bf01
Moved tests directories from contributing/new_workflow_samples to contributing/workflow_samples.
Removed contributing/new_workflow_samples directory.
Preserved agent.py files in workflow_samples to maintain feature flag support.
Change-Id: Ic59973c513997dbfd7a3aa278968efa4cc374ef8
In the new _workflow_class.py Workflow, leaf single_turn LlmAgents now
run through SingleAgentReactNode instead of _SingleLlmAgent. This
enables proper event deduplication via _output_delegated — only the
LlmCallNode content event appears in the stream, not a duplicate
wrapper output event.
The old _workflow.py Workflow retains the original _SingleLlmAgent
path. Runtime detection uses event_queue presence on InvocationContext
to distinguish the two paths.
Also updates the use_as_output sample to use an LLM agent as the
delegated child node, and rewrites wrapper tests per adk-style
guidelines covering both old and new workflow paths.
Change-Id: I96aea3f12fe432d0449268eb75580c900fd047d7
Add node_info.output_for to Event -- a list of node paths whose output
an event represents. For normal nodes it contains just the node own
path. When use_as_output=True delegation is used, it includes the full
ancestor chain (child path + all delegating parent paths).
Also adds a contributing sample demonstrating use_as_output with a
downstream edge in the new Workflow architecture.
Change-Id: I7e11276f894a3a2b396759dd146c221b487d4a7c
Add auth_config field to FunctionNode that pauses for user
authentication before running. The auth gate lives inside
FunctionNode.run(), keeping _node_runner generic.
Utility functions in _workflow_hitl_utils:
- create_auth_request_event: builds adk_request_credential FC event
with user-facing message
- process_auth_resume: stores credentials with plain value fallback
- has_auth_credential: checks if credentials exist in state
Unwrap {"result":...} for auth responses in _process_resumptions,
consistent with request_input handling.
Includes sample agent and tests for auth flow and credential reuse.
Change-Id: Ib81bf9cf63b8282efd7898def17f6e47a95b2d05
When a node raises an exception, emit an Event with error_code and
error_message before propagating the error. This makes failures
visible in the event stream (web UI, CLI) without requiring nodes
to manually yield error messages.
Applies to all node types via _node_runner, covering both unhandled
exceptions and timeouts.
Update retry sample to remove manual error message yield.
Change-Id: I4598cd288f1201416086149f3af44f8c8c10c1a4
Introduces two major capabilities:
- Workflow runtime: graph-based execution engine for composing
deterministic execution flows for agentic apps, with support for
routing, fan-out/fan-in, loops, retry, state management, dynamic
nodes, human-in-the-loop, and nested workflows
- Task API: structured agent-to-agent delegation with multi-turn
task mode, single-turn controlled output, mixed delegation
patterns, human-in-the-loop, and task agents as workflow nodes
Co-Authored-By: Bo Yang <ybo@google.com>
Co-Authored-By: George Weale <gweale@google.com>
Co-Authored-By: Sean Zhou <seanzhougoogle@google.com>
Co-Authored-By: Shangjie Chen <deanchen@google.com>
Co-Authored-By: Swapnil Agarwal <swapnilag@google.com>
Co-Authored-By: Wei Sun <weisun@google.com>
Co-Authored-By: Xuan Yang <xygoogle@google.com>
Co-Authored-By: Yifan Wang <wanyif@google.com>
Change-Id: I35932c50cfe29ff68559e3781713dbb5eb7b3382