Agent Wealth HubFree public resources
中文 EN العربية

Back to catalog / Agent workflows

Route an agent workflow through a safe branch based on validation

Encode explicit conditional routing in workflow edges so invalid inputs take a clarification or rejection path.

Goal

Make the workflow branch on validated state instead of letting a model decide whether to bypass checks.

Steps

  1. Define the condition input and every path, making the default branch fail safely. [workflow]
  2. Have a validation node produce a stable routing marker; avoid free text for control decisions. [workflow]
  3. Declare conditional edges and connect separate accept, reject, or clarification nodes. [workflow]
  4. Test each boundary and unknown condition; ensure they do not fall into the success branch. [workflow]

How to verify

Each input class takes the expected path; unknown or missing routing markers stop safely rather than defaulting to approval.

Troubleshooting

If the condition is always false, check the prior node writes the expected state key; do not change the safe default to allow.

Permissions

Prerequisites

Permissions

Limitations

This procedure follows Google ADK at the pinned revision; other versions, models, or remote services may differ in APIs and event semantics. Recheck permissions, retention, and recovery before production.

Pinned upstream source

https://github.com/google/adk-python/blob/e9b74d36140f2594b24c481fb7a3825b2cb01e96/docs/guides/workflow/workflow/index.md

Repository
google/adk-python
File path
docs/guides/workflow/workflow/index.md
Pinned commit
e9b74d36140f2594b24c481fb7a3825b2cb01e96
Source checked
2026-10-14 · Reviewed against the pinned upstream source

Repository metrics

These values describe the upstream repository, not popularity or likes for an individual skill or playbook.

Stars
Not collected
Forks
Not collected
Observed at
Not collected

No metrics snapshot is available yet.

License: Apache-2.0

Main topic

Turn ecommerce campaign materials into a reviewable weekly brief

Related resources