Designing Workflow
The workflow design maps the agent's steps, decision points, and transitions into a complete execution graph before implementation.
Workflow Design Steps
1. List all nodes: every distinct action the agent takes is a node
lookup_order | check_eligibility | issue_refund | reject_refund | request_approval | send_email | escalate
2. Define start and end nodes:
START → lookup_order
send_email → END
escalate → END
3. Define edges with conditions:
lookup_order → found: check_eligibility
lookup_order → not_found: escalate
check_eligibility → eligible + auto: issue_refund
check_eligibility → eligible + manual: request_approval
check_eligibility → ineligible: reject_refund
request_approval → approved: issue_refund
request_approval → rejected: reject_refund
issue_refund → success: send_email
issue_refund → error: escalate
reject_refund → *: send_email
4. Identify human checkpoints:
request_approval: the workflow pauses and waits for human decision
5. Validate the graph:
- Every node is reachable from START
- Every path eventually reaches END or escalate
- No circular dependencies