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
- Define the condition input and every path, making the default branch fail safely. [workflow]
- Have a validation node produce a stable routing marker; avoid free text for control decisions. [workflow]
- Declare conditional edges and connect separate accept, reject, or clarification nodes. [workflow]
- 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
- Python 3.11+, google-adk compatible with the pinned revision, and an isolated test environment
- Configured model-provider credentials for live inference; never place them in code or logs
Permissions
- Use authorized test data only; isolate sessions and credentials per user; obtain human authorization before external side effects
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
- 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