A failure pattern in refund automations that is worth ten minutes on your own workflow. No client or account is identifiable here - it is reconstructed from what people have reported publicly and then reproduced, because that is the version anyone can check.
The setup: refunds over a ceiling need a second sign-off. Ceiling 250. Two refunds of 200 each went out, both auto-approved, every step green, the ledger updated. Nobody saw an error because there wasn't one. Each step did exactly what it was configured to do.
The cause, in one sentence: the ceiling is compared against the incoming request instead of against what has already been committed, and the ledger row is written one step after the check.
So each 200 starts its own request, compares 200 to 250, passes. The running total only exists after the check already approved. Two runs that each respect the cap add up to a breach no single run can see.
Three things usually stack on top of it:
- Check and write are separate steps. Between them a retry, a duplicate webhook, or a reviewer editing the amount changes the number that gets written. The check ran against a value that no longer exists by the time the write happens.
- Idempotency keyed to the run instead of the request. A retried execution doesn't dedupe - it double-books, and both copies look like legitimate approvals.
- The reviewer path. If an approver can edit the amount before approving, the amount you validated is not the amount you committed.
How to prove it to yourself before changing anything:
- Compare the ceiling against a cumulative figure read from the ledger, not against the incoming amount.
- Make the write conditional: only apply it if the new total still fits, and treat "zero rows changed" as a rejection rather than a success.
- Key idempotency to the order or request identity so a retry can't create a second approval.
- Re-run the check after any reviewer edit.
In GHL specifically there is no atomic conditional update in the action list, so the practical version is: dedupe on the order id, read the sum immediately before the write, and move the ceiling decision itself into a Code or backend step rather than an If condition on the incoming amount. An If on 200 vs 250 can never see the other 200.
Then test the ugly cases, not the happy one: 150 then 90 (should pass), 99 and 1000 (should fail), two 200s against a 250 cap (the second should fail), the same approval delivered twice, two approvals landed at the same moment, and 0 and -50.
The general rule I take from it: a green run only proves the step you can see. Anything that sums across runs has to be checked against the thing it sums, at the moment it commits.
Platform changes the syntax, not the failure. If yours does the same thing, the useful question is which side of the write the ceiling read happens on.
The other checklists like this are the other posts on my profile.