The situation
A service team receives ambiguous warranty requests as free text. Its policy is deterministic: entitlement must be valid, a prior refund blocks another refund, and refunds above 500 currency units require a supervisor. Salesforce owns Case status and approval evidence; an external payment service owns payment execution. The team targets a two-second acknowledgement and wants to avoid model calls for routine rule checks. A payment can succeed even if its response times out.
Design the workflow. (1) Assign interpretation, orchestration, eligibility checks, and complex processing to Agentforce, Flow, Apex, people, or the external service, and justify latency/cost trade-offs. (2) Explain how mandatory rules are enforced independently of a model's recommendation. (3) Define a narrow refund action contract and validate identity, Case/order relationship, amount, and allowed state transition on the server. (4) Bind supervisor approval to the exact proposed transaction and revalidate before execution. (5) Trace a timeout after payment success: explain local transaction boundaries, duplicate prevention, reconciliation/compensation, and observable audit evidence. Do not assume a Salesforce rollback can undo an external payment. Different Flow/Apex splits are acceptable when justified.
Consider in your response
- Separate deterministic policy from natural-language reasoning
- Design validated agent actions
- Bind approval to high-risk transactions
- Handle distributed failures without duplicate side effects