Back to catalog / Agent workflows
Verify a synthetic patient before lab-prep instructions
Collect identity over multiple turns, route on a mock identity check, then confirm an order lookup before generating preparation instructions.
Goal
Complete identity intake and a mock order lookup for a synthetic patient, producing preparation guidance tied to the returned orders.
Steps
- Define PatientIdentity with name and phone_number; use mode="task" and output_schema to collect both fields before advancing. [src-google-verify-patient-identity-before-lab-prep-instructions]
- Pass the structured identity to check_identity; route a mock miss back to intake_agent and a Jane Doe match to generate_instruction. [src-google-verify-patient-identity-before-lab-prep-instructions]
- Set require_confirmation=True on find_orders; confirm the mock lookup, then generate concise preparation instructions from its returned orders. [src-google-verify-patient-identity-before-lab-prep-instructions]
How to verify
Try the Jane Doe and John Doe examples: Jane should receive mock orders and preparation text after confirmation; John should return to intake. Missing phone_number should trigger another question.
Troubleshooting
If identity checking runs with a missing field, inspect PatientIdentity.output_schema and task mode. If Jane Doe has no orders, check the mock find_orders data; do not connect a real patient database.
Permissions
Prerequisites
- A Python environment and Google ADK project; credentials for the selected model provider. Use synthetic patients and local mock order data.
Permissions
- The intake conversation sends the supplied name and phone number to the configured model provider; find_orders queries the sample mock database and requires confirmation before execution. It does not access real records or lab systems.
Limitations
Identity checking uses mock database logic; the Jane Doe branch only demonstrates routing. Generated preparation text is not a medical order or clinical advice.
Pinned upstream source
- Repository
- google/adk-python
- File path
- contributing/samples/workflows/agent_in_workflow/README.md
- Pinned commit
2d0eb955972803781d209a45d71b958b2c8addef- 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
Make Agent behavior safer and easier to verify