flow
Propose AR Collections Email — command lifecycle
One propose_ar_collection_email call end to end: queue → human reviews AND CAN EDIT subject/body → approve is the send → Graph sendMail → MutationApplied.
Flow
Overview
The most outward-facing write in the system — a customer receives it — so the approval is the send gate, and the edit-at-send path (unique to this kind) snapshots the human’s edited subject/body onto the proposal before apply: the audit trail records exactly what was approved, not what was proposed. Blocked on Mail.Send admin consent before live.
The flow
How it works
- Max (agent) on claude.ai → MCP tool call
- Propose AR Collections Email → queue only — no vendor write
- Approval Bus queues the proposal → pending + widget token minted
- Proposal Created → approval card renders
- Cleared human reviews the card → human click — approve
- Commit Approval (app-only) → RBAC + atomic pending→approved claim
- Approval Bus claims + dispatches → exactly-once claim
- Proposal Approved → dispatch by kind: ar-collections-email
- ArCollectionsApplier — send exactly what was approved → the approved (possibly edited) email
- Graph Send Mail → the one vendor write
- Microsoft 365 (Graph) → result recorded on the proposal
- Mutation Applied → card refreshes
- Terminal: proposal
applied(a thrown apply recordsfailedinstead — Mutation Failed)