Use Case Library

Production-ready approval workflow patterns. Each scenario ships with complete TypeScript, handles the edge cases you'll actually hit in production, and includes test examples using ApprovalTestKit.

6 scenarios 18+ edge cases 380 tests complete TypeScript
Finance & ERP

Accounts Payable Approval

Auto-build 1–4 level chains from invoice amount. Under $1k needs one approver; over $50k routes to the board. Handles concurrent race conditions with optimistic locking.

Edge cases covered
  • Concurrent approvals race condition
  • SLA breach escalation
  • Department head delegation
View full example
HR Systems

HR Leave Request Workflows

Type-aware approval chains. Annual leave routes through manager and HR. Emergency leave skips the manager and goes straight to HR. Extended leave adds department head.

Edge cases covered
  • Manager on leave — out-of-office cover
  • Overlapping team quota check
  • Same-day emergency leave straight to HR
View full example
Procurement

Purchase Order Routing

IT, Operations, and Marketing procurement each follow different chain templates. Enterprise software requires Security sign-off. Finance added for all POs over $10k.

Edge cases covered
  • Split PO detection before submission
  • Reject and resubmit a revised PO
  • Emergency bypass with audit trail
View full example
Finance & HR

Employee Expense Reimbursement

Auto-approve small expenses after manager sign-off. Large or international expenses get Finance and Compliance review. Foreign currency locked at submission time.

Edge cases covered
  • Duplicate expense detection
  • Foreign currency lock-in
  • Receipt validation before submission
View full example
Legal

Contract Approval Pipeline

Legal review before every contract execution. High-value contracts add Finance and board levels. An amended contract is resubmitted, so the chain is evaluated again against the new value.

Edge cases covered
  • Amendments restart the chain
  • External counter-signature webhook
  • Legal hold mid-approval
View full example
SaaS Architecture

Per-Tenant Approval Rules

Each tenant configures their own approval chain via your admin UI. Basic tenants get a simple template; Enterprise tenants store custom chains in your database.

Edge cases covered
  • Tenant suspended mid-approval
  • Chain misconfiguration validation
  • Cross-tenant partner approvals
View full example