Skip to content

Speed Limits

Module 4 of 8 in the chapter Salesforce as an API Consumer, chapter 9 of the Integration Architect course. Each module stands on its own. Previous: Dealing With the Answer · Next: Where a Callout Can Run

The question this module answers: What limits does Salesforce put on callouts, and which one will surprise you in production?

Salesforce doesn’t like waiting for other systems. It’s a multitenant platform: every org shares the servers, so a transaction that sits and waits holds resources someone else could use. So you’re best with short and fast calls to an external system. And there are speed limits to keep you honest.

When you’re making callouts, you’ve got four things to watch: how big is my payload, how many individual calls, how long is a single call, and what’s the total across all the calls. These are your limits.

Per transaction, on Winter ‘27 (Execution Governors and Limits (opens in a new tab) and Callout Limits and Limitations (opens in a new tab), Apex Developer Guide, checked 2026-10-31):

LimitSynchronousAsynchronous
Callouts100100
One callout’s timeout10 seconds by default, up to 120the same
All callouts together120 seconds120 seconds
Heap: everything in memory, including the answer10 MB25 MB

So you can make 100 one-second calls, or one 120-second call, but not both. Read the 120 seconds the right way: it’s what Salesforce allows, not what a person will put up with. If someone hits Save and waits two minutes, something’s wrong with the design. Kick the work to an asynchronous process and let them get on with their day (module 5).

The heap one bites hardest, because it doesn’t fail gently. A transaction that goes over the heap gets “an uncatchable System.LimitException error” (same page). Your try and catch from module 3 won’t save it. If an answer could be big, decide before you call: ask for less, page through it, or move the data another way.

And in a Developer Edition org, you can only have 20 callouts going out at the same time. It’s a limit you’ll meet in a lab, not in production.

Now the one that waits for production.

Every org has a limit on long-running transactions: synchronous Apex that runs for more than 5 seconds. I call those red transactions. Each one, on its own, is allowed. But there’s a limit on how many can be red at the same time across the whole org. Today it’s set by your licences: one for every 100 licences, at least 10 and at most 50. Go over, and new ones are denied (same page).

Here’s why it surprises people. In development and testing, you never notice it. Two testers can’t make ten red transactions at once. I was consulting at one client where creating a field-service appointment was taking three to eight seconds. It worked just fine in development, in test, in QA. Then it went to production, with all the dispatchers making appointments at once, and random ones started being killed. They were exceeding the number of long-running transactions. When the next client needed appointments, I designed a whole different appointment check, because I knew this limit was waiting for us. It’ll get you when you least expect it, and only in production, which is the worst time.

The good news for callouts: the time spent waiting for a callout doesn’t count. Salesforce pauses the timer while it waits, and “HTTP callout processing time isn’t included when calculating this limit” (same page). That changed in Winter ‘20; before it, a slow callout could turn a transaction red. So what makes a transaction red today is slow work inside Salesforce: heavy triggers, complicated automation, big queries. In my story, it was the appointment work, not the waiting.

What turns a transaction red What turns a transaction red. On the left, three synchronous transactions. Short and fast, under 5 seconds of work, in green, finishes in time; and waiting on a callout, in green, where the wait is paused: both lead to not counted, the limit never sees them. Slow work inside Salesforce, an appointment taking 3 to 8 seconds, in amber and tagged red, takes a place in the whole org's pool of long-running transactions at once, in navy: 1 per 100 licences, 10 to 50; over that, new ones are denied. Underneath: two testers never fill the pool; production does; test at the real number of users. {"author": "Steve Simpson", "blueprint": "1.0.0", "builder": "standard 1.57.1", "built": "2026-10-31", "id": "DGM-INT-SC-04", "rights": "\u00a9 2026 Twinshark LLC. All rights reserved.", "template": "cells 0.5.0", "theme": "stevetecharc 1.4.0"} THREE SYNCHRONOUS TRANSACTIONS THE WHOLE ORG Short and fast under 5 seconds of work Waiting on a callout the timer pauses while it waits Slow work inside Salesforce an appointment taking 3 to 8 seconds red Not counted the limit never sees them Long-running transactions, at once 1 per 100 licences, 10 to 50; over that, new ones are denied finishes in time the wait is paused takes a place Two testers never fill the pool. Production does. Test at the real number of users. HOW TO READ IT doesn't count toward the limit a red transaction: counts while it runs © 2026 Twinshark LLC · stevetecharc.com
Click to enlarge

What turns a transaction red. Waiting on a callout doesn’t; slow work inside does.

Don’t mix this up with the limit from chapter 8. That one is about calls coming in: no more than 25 inbound API calls of 20 seconds or more at once in production. This one is about Salesforce’s own Apex running more than 5 seconds, 10 to 50 at once by licences. Same idea, different doors, different numbers. Both punish slow work under load, and both only show up when the load is real.

  • Count before you build. For every callout: how big is the answer, how many calls per transaction, how long does each take, and how many happen at once at the peak? Chapter 6’s number of zeros gives you the peak.
  • Set the timeout from the other system’s real speed, not the default, and decide what happens when it’s hit.
  • Keep the transaction short around the callout. If the work before or after the call is slow, the transaction turns red whatever the call does.
  • Test at production load. The red-transaction limit is invisible with two testers. A load test at the real number of users is the only way to see it before your users do.
  • The four numbers for every callout: payload size, calls per transaction, time per call, and calls at once at the peak.
  • Which callouts can make a person wait, and which go asynchronous.
  • The biggest answer the heap must hold, with room to spare, and what happens if it’s bigger.
  • The load test, at the real number of users, before go-live.