The Infinite Flow Loop That Ate Production
“Record-triggered flow updates the same object. Flow fires again. And again. And again.”
What Happened
I built a record-triggered flow on Opportunity that updated a rollup field on the same Opportunity. Seemed harmless. Deployed on a Tuesday afternoon. Within 30 seconds, every Opportunity edit in the org triggered an infinite loop that burned through our CPU limits and locked out the entire sales team at Mobilization Funding for two hours.
The Wrong Way
// Record-Triggered Flow on Opportunity (After Save)
// Entry Criteria: ISCHANGED({!$Record.Amount})
// Action: Update Records → Current Opportunity
// Set StageName = "Negotiation" if Amount > 50000
// Problem: This update triggers the SAME flow again,
// because the record was updated, and the flow
// has no recursion guard.The Right Way
// Record-Triggered Flow on Opportunity (After Save)
// Entry Criteria: ISCHANGED({!$Record.Amount})
// AND {!$Record.Amount} > 50000
// AND {!$Record.StageName} != "Negotiation"
// ^^^ This condition prevents re-entry because after
// the first run, StageName IS "Negotiation"
//
// Also: Flow Settings → "Run flow in a transaction
// with the original DML operation"
// And toggle OFF "Allow this flow to re-trigger"The Lesson
Every record-triggered flow needs an exit condition that prevents re-entry. If you update the same object, you MUST check that the value isn't already what you're setting it to.
Enjoyed this? Get more like it.
Glen's Musings — AI, investing, and building things. Occasional. Free.
More Flows Mistakes
Get Records Inside a Loop: The Governor Limit Speedrun
Put a Get Records element inside a loop. Hit 100 SOQL queries on the 101st record.
Read moreAnnoyingThe Flow With No Fault Path (Enjoy Your Cryptic Error)
Deployed a screen flow with no fault handling. Users got 'An unhandled fault has occurred' and I got 50 support tickets.
Read morePainfulHardcoded Record IDs in Flows: The Sandbox Surprise
Hardcoded a Record Type ID in a flow. Deployed to production. Different ID. Everything broke.
Read more