adk-workflows
Requires `google-adk >= 2.0.0`. Python only. Requires **Python >= 3.11**. The `Workflow` class itself does not support Live Streaming (`Runner.run_live`) — the…
* **`Agent`**: The core intelligent unit. Can be `LlmAgent` (LLM-driven) or `BaseAgent` (custom/workflow). * **`Tool`**: Callable function providing external capabilities (`FunctionTool`, `AgentTool`, etc.). * **`Session`**: A stateful conversation thread with history (`events`)
$ npx -y skills add google/agents-cli --agent claude-codeHow it fires
How this agent gets triggered: by you, by Claude, or both.
Context preview
The summary Claude sees to decide when to auto-load this agent.
* **`Agent`**: The core intelligent unit. Can be `LlmAgent` (LLM-driven) or `BaseAgent` (custom/workflow). * **`Tool`**: Callable function providing external capabilities (`FunctionTool`, `AgentTool`, etc.). * **`Session`**: A stateful conversation thread with history (`events`)
your_project_root/ ├── <agent_name>/ or app/ # Agent code directory │ ├── __init__.py │ ├── agent.py # Contains root_agent definition │ ├── tools.py # Custom tool functions │ └── .env # Environment variables ├── tests/ │ ├── eval/ │ │ ├── eval_config.yaml # Eval criteria and thresholds │ │ └── datasets/ # Eval datasets (JSON) │ ├── integration/ │ └── unit/ └── pyproject.toml or requirements.txt
---
from google.adk.agents import Agent
def get_weather(city: str) -> dict:
"""Returns weather for a city."""
return {"status": "success", "weather": "sunny", "temp": 72}
my_agent = Agent(
name="weather_agent",
model="gemini-3.7-flash",
instruction="You help users check the weather. Use the get_weather tool.",
description="Provides weather information.", # Important for multi-agent delegation
tools=[get_weather]
)from google.genai import types as genai_types
from google.adk.agents import Agent
agent = Agent(
name="my_agent",
model="gemini-3.7-flash",
instruction="Your instructions here. Use {state_key} for dynamic injection.",
description="Description for delegation.",
# LLM generation parameters
generate_content_config=genai_types.GenerateContentConfig(
temperature=0.2,
max_output_tokens=1024,
),
# Save final output to state
output_key="agent_response",
# Control history sent to LLM
include_contents='default', # 'default' or 'none'
# Delegation control
disallow_transfer_to_parent=False,
disallow_transfer_to_peers=False,
# Sub-agents for delegation
sub_agents=[specialist_agent],
# Tools
tools=[my_tool],
# Callbacks
before_agent_callback=my_callback,
after_agent_callback=my_callback,
before_model_callback=my_callback,
after_model_callback=my_callback,
before_tool_callback=my_callback,
after_tool_callback=my_callback,
)> **Warning**: Using `output_schema` disables tool calling and delegation.
from pydantic import BaseModel, Field
from typing import Literal
class Evaluation(BaseModel):
grade: Literal["pass", "fail"] = Field(description="The evaluation result.")
comment: str = Field(description="Explanation of the grade.")
evaluator = Agent(
name="evaluator",
model="gemini-3.7-flash",
instruction="Evaluate the input and provide structured feedback.",
output_schema=Evaluation,
output_key="evaluation_result",
)# Use dynamic state injection with {state_key} placeholders
instruction = """
You are a {role} assistant.
User preferences: {user_preferences}
Rules:
- Always use tools when available
- Never make up information
"""---
Workflow agents provide deterministic control flow without LLM orchestration.
> These are `BaseAgent`-family composites (`SequentialAgent`, `ParallelAgent`, `LoopAgent`). For the new graph-based Workflow API introduced in ADK 2.0, see `references/adk-workflows.md`.
Executes sub-agents in order. State changes propagate to subsequent agents.
from google.adk.agents import SequentialAgent, Agent
summarizer = Agent(
name="summarizer",
model="gemini-3.7-flash",
instruction="Summarize the input.",
output_key="summary"
)
question_gen = Agent(
name="question_generator",
model="gemini-3.7-flash",
instruction="Generate questions based on: {summary}"
)
pipeline = SequentialAgent(
name="pipeline",
sub_agents=[summarizer, question_gen],
)Executes sub-agents concurrently. Use distinct `output_key`s to avoid race conditions.
from google.adk.agents import ParallelAgent, SequentialAgent, Agent
fetch_a = Agent(name="fetch_a", ..., output_key="data_a")
fetch_b = Agent(name="fetch_b", ..., output_key="data_b")
merger = Agent(
name="merger",
instruction="Combine data_a: {data_a} and data_b: {data_b}"
)
pipeline = SequentialAgent(
name="full_pipeline",
sub_agents=[
ParallelAgent(name="fetchers", sub_agents=[fetch_a, fetch_b]),
merger
]
)Repeats sub-agents until `max_iterations` or an event with `escalate=True`.
from google.adk.agents import LoopAgent
refinement_loop = LoopAgent(
name="refinement_loop",
sub_agents=[evaluator, refiner, escalation_checker],
max_iterations=5,
)For a production LoopAgent with EscalationChecker, BuiltInPlanner, and grounding citations, look it up in the topic index in `references/samples.md`.
---
1. **Shared State**: Agents read/write `session.state`. Use `output_key` for convenience.
2. **LLM Delegation**: Agent transfers control to a sub-agent based on reasoning.
coordinator = Agent(
name="coordinator",
instruction="Route to sales_agent for sales, support_agent for help.",
sub_agents=[sales_agent, support_agent],
)3. **AgentTool**: Inv
The CLI and skills that turn any coding assistant into an expert at creating, evaluating, and deploying AI agents on Google Cloud.
Repo: google/agents-cli
Requires `google-adk >= 2.0.0`. Python only. Requires **Python >= 3.11**. The `Workflow` class itself does not support Live Streaming (`Runner.run_live`) — the…
Recipes live in [google/adk-samples](https://github.com/google/adk-samples). **`core/python/`** is the curated tier — canonical ADK patterns maintained by the…
**Assumes `/google-agents-cli-scaffold` scaffolding.** If your project isn't scaffolded yet, see `/google-agents-cli-scaffold` first.
Invoke your agent as a BigQuery Remote Function for batch inference over table rows. This requires a custom `POST /` endpoint since BQ cannot use URL paths.
**Best for:** Production applications, teams requiring staging → production promotion.