Rule registry · FL-013

Get records must have filters

Checked by the Salesforce Flow scan. Severity high.

FL-013HighPerformance

What it requires. Every Get Records element must have at least one filter condition defined. Unfiltered Get Records queries retrieve all records of the target object up to the 50,000 record SOQL retrieval limit, which causes flows to fail in any org with meaningful data volumes.

Why it matters. Salesforce enforces a hard limit of 50,000 records retrieved by SOQL queries per transaction. An unfiltered Get Records element on a high-volume object such as Contact, Account, or Opportunity will hit this limit as the org grows, throwing a System.LimitException and halting the transaction. This is a latent failure: the flow works in a fresh sandbox and breaks silently in production as record counts increase.

How to fix it. Add specific filter conditions to every Get Records element to restrict the query to only the records the flow requires. Never query an entire object without a limiting filter. If a broad query is genuinely required, document the reason and ensure the result set will remain well below 50,000 records.

Source. Apex Developer Guide: Execution Governors and Limits – 50,000 rows retrieved by SOQL queries per transaction

Is this rule worth checking?

Votes and comments are published here. We read them, and we publish what we change with the reasoning — a vote does not move a rule on its own.

Every rule we check, every source, and every one we turned down