What the Workflow Owns
The workflow should control:- Case state
- Deadline checks
- Branch routing
- Tool call order
- Retry and failure paths
- Human approval gates
- Handoffs to subflows
- Status updates back to the source system
Main Flow
Subflows
Break repeated deterministic logic into callable workflows:| Subflow | Purpose |
|---|---|
| Case validation workflow | Normalize and validate required fields. |
| Deadline workflow | Calculate deadline risk and escalation priority. |
| Acceptance workflow | Record that the business accepts liability or will not contest. |
| Evidence preparation workflow | Gather evidence, draft packet, and prepare approval request. |
| Human approval workflow | Route packet to reviewers and wait for decision. |
| Submission workflow | Submit to processor or record manual submission. |
| Outcome tracking workflow | Check outcome, update source systems, and notify stakeholders. |
Agent Calls
Use focused agents with clear contracts:| Agent | Called by | Expected output |
|---|---|---|
| Reason classification agent | Main workflow | Reason category, confidence, recommended path, explanation. |
| Account communication agent | Main workflow | Message draft, requested information, language, next wait state. |
| Evidence drafting agent | Evidence workflow | Draft narrative, evidence checklist, missing facts, confidence. |
| Slack escalation agent | Approval workflow | Reviewer decision, comments, required changes, approver identity. |
Branching Guidelines
Use deterministic branches for conditions such as:- Response deadline has passed
- Case value is above approval threshold
- Required evidence is missing
- Account response is overdue
- Reviewer rejected the evidence packet
- Tool call failed
- Whether the reason text maps to one or more categories
- What clarification to request from the account
- How to summarize evidence in a clear narrative
- Whether reviewer comments imply a specific correction
Related Docs
Workflows
Learn when to use deterministic workflows.
Nodes and Conditions
Build branches, tool nodes, and conditions.
Sub-Agents
Call focused agents from workflows and agents.
Guardrails
Add escalation and restriction rules.