Incident Response — Null formula vs. trigger order

Salesforce FlowsRoot Cause AnalysisIncident ManagementTest Automation

What it is

Root cause, fix and verification of a production failure on a Salesforce-based claims platform (Riskonnect) at DSV. One configuration change — a run-order value on one automation — made claim registrations sent by API fail for two claim types, and silently saved wrong flags on a third. It was a priority-1, the platform's owner was on holiday, and it was my first Riskonnect issue. With an AI agent in the sandbox the error was reproduced in 17 minutes; after the weekend the run-order change behind it was found, the fix was verified against 143 test cases written for it, and it was live in production 4 h 17 min later.

The Salesforce behaviour behind it

Two platform rules, each harmless alone:

  1. Ordered record-triggered flows run before unordered ones. Giving one flow a trigger-order value moves it ahead of every flow that has none — including the one that calculates the amount it depends on.
  2. A bare comparison on a blank number is null, not false. A generic example: Amount__c > 1000 on an empty amount does not evaluate to false; the whole formula becomes null, and the decision or validation built on it behaves differently from what anyone tested.
Zoom

Before the change the amount calculation ran first, so the formula always saw a value.

Why it was hard

  • Two failure modes from one change. The loud one (rejected registrations) was found immediately. The silent one (wrong flags, no error) only showed up later, through the same analysis.
  • Production and sandboxes differed. The flow versions in the sandbox were not the ones running in production, so the failure did not reproduce out of the box.
  • No regression suite existed to prove a fix would not break the other automations.

What I did

Zoom
  • Rebuilt production's exact flow versions in a sandbox so the failure reproduced deterministically.
  • Wrote isolated tests that showed the formula going null when the amount was not yet calculated.
  • Made the formulas null-safe and restored the original dependency order — either alone would have left a trap for the next change.
  • Generated 143 cases: a threshold matrix around every amount boundary plus the business's own UAT table, run in the partial sandbox and in UAT before production.
  • Wrote the incident report, a lessons-learned note and the retrospective material for the team.

Key decisions & tradeoffs

Fix both causes, not one. Restoring the order alone would have fixed the symptom while leaving formulas that break on the next reorder. Making them null-safe alone would have hidden a wrong dependency. Both changes went in together, covered by the same cases.

Generate the cases. Hand-picking a few claims would have tested what we expected. A generated threshold matrix tested every boundary of every amount-based rule, which is what made it safe to ship.

Look for the silent failure. Once the mechanism was understood, the question became "what else did this change touch without erroring?" — which is how the wrong-flag side was found.

What I learned

  • In Salesforce, adding an order value to one flow reorders it relative to every unordered flow on the object.
  • Blank numbers make comparisons null. Wrap them (BLANKVALUE, explicit ISBLANK checks) wherever a formula reads a value another automation calculates.
  • A config change can have a loud and a silent failure mode. The silent one is the expensive one.

Results

  • 17 minutes to reproduce the error and 27 to a first fix proposal (measured); about 2.5–3.5 hours of active session time to the verified fix (estimated), over two working days, Friday and Monday.
  • 143 generated cases green in two sandboxes before production; live 4 h 17 min after verification, put live by the owner the day they were back.
  • Daily rejections stopped; the silent side was corrected record by record.
  • The verification suite became the seed of the regression suite and release gate.

Stack

Salesforce record-triggered flows, formulas, Apex tests, SOQL, Salesforce CLI, Python.

Status