From 417e2a24dfb313065b2efce35ef59fcbb586d9a3 Mon Sep 17 00:00:00 2001 From: winter-street Date: Fri, 18 Sep 2026 23:20:23 +0800 Subject: [PATCH] docs(workflow): make the single-turn node example runnable The example imported `build_node` from `google.adk.workflow`, which does not export it, so the snippet raised ImportError. `build_node` is also unnecessary: `Workflow` wraps node-like objects in `edges` automatically. The trailing `(writer_node, "END")` edge used a string that is not a valid node-like value, which raises WorkflowConfigurationError. Pass the agent directly and drop the terminal edge, matching the other workflow guides. --- docs/guides/agents/llm_agent/single_turn.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/docs/guides/agents/llm_agent/single_turn.md b/docs/guides/agents/llm_agent/single_turn.md index b0904936985..4b8663a4a04 100644 --- a/docs/guides/agents/llm_agent/single_turn.md +++ b/docs/guides/agents/llm_agent/single_turn.md @@ -34,7 +34,7 @@ When building a `Workflow` graph, any `LlmAgent` added to the graph defaults to ```python from google.adk.agents import LlmAgent -from google.adk.workflow import Workflow, build_node +from google.adk.workflow import Workflow # Defaults to mode="single_turn" when run as a node writer_agent = LlmAgent( @@ -42,13 +42,10 @@ writer_agent = LlmAgent( instruction="Write a short story about the input topic." ) -writer_node = build_node(writer_agent) - wf = Workflow( name="story_generator", edges=[ - ("START", writer_node), - (writer_node, "END") + ("START", writer_agent) ] ) ```