Salesforce Too Many SOQL Queries: 101 Error

Share
Workaround available Flow, Apex Updated November 13, 2026Based on 4 user reportsHow we research

Quick answer

The transaction ran more than 100 SOQL queries. Move queries out of loops (Get Records in a Flow loop, queries in Apex loops) and check for recursion.

Most likely fix: Bulkify the Flow

How to fix it

Try these in order — the most common fix is first.

  1. 1. Bulkify the Flow

    1. Open the Flow in Setup > Flows
    2. Move any Get Records element out of the Loop
    3. Query once for the whole collection, then loop over it in memory
    4. Use a Decision to skip records that need no lookup
    Did this fix it?
  2. 2. Bulkify Apex

    1. Collect IDs into a Set before the loop
    2. Run one SOQL query with WHERE Id IN :ids
    3. Store results in a Map and read from it inside the loop
    Did this fix it?
  3. 3. Check recursion and other automation

    1. Use a static boolean in trigger handlers to run logic once per transaction
    2. Review other Flows, Process Builders and packages on the same object
    3. Use debug logs and Limits.getQueries() to see where queries are spent
    Did this fix it?
  4. 4. Test with bulk volumes

    1. Test with 200 records, not one, because the error often appears only on data loads
    Did this fix it?

Symptoms

A Flow, trigger or data load fails with System.LimitException: Too many SOQL queries: 101.

Why it happens

  • Get Records inside a Flow Loop
  • SOQL inside an Apex for loop
  • Several automations and managed packages in one transaction share the limit
  • Trigger recursion

This guide also covers

  • too many soql queries 101
  • salesforce flow too many soql queries
  • systemlimitexception too many soql

Still not working?

If Salesforce keeps failing, you're not alone. See every Salesforce problem users report or the alternatives people switch to.

Done fighting Salesforce? Our small team builds your own Salesforce alternative, made for how you work. On your domain or hosted by us. Price agreed together.

Get a quote
Fixed it? Share this guide

The same problem in other apps

All not loading, error messages & connection guides →

Other Salesforce errors

All 10 Salesforce errors and fixes →