Tuesday, 27 October 2026

Latest comes with Strings Attached in Winter '27


Image generated by ChatGPT 5.6 Sol based on a prompt by Bob Buzzard

Introduction

The Winter '27 Salesforce release includes a developer quality-of-life improvement, the option to always target the latest supported version of the REST API by using the alias latest in place of the explicit version number. For example, if I want to hit the latest version in my developer edition, rather than specifying API version 68.0 for Winter '27:

    https://kabtutorial-dev-ed.my.salesforce.com/services/data/v68.0/sobjects/Account

I can use latest:

    https://kabtutorial-dev-ed.my.salesforce.com/services/data/latest/sobjects/Account

No more updating the REST API versions of my integrations every 4 months just to keep them on the latest version, and I can stop worrying about API version retirement as I'll always be on the latest and greatest. What's not to like?

Convenience versus Control

There's no argument that this is more convenient. My integrations automatically use whatever Salesforce considers current, no action required. This also represents a loss of control though, as my integrations automatically use whatever Salesforce considers current. Even if that causes problems. 

My code remains the same, but a dependency changes underneath it, for good or bad. In a few months time latest will mean v69.0 whether I'm ready for it or not. This doesn't mean that I'd expect failure, but new API versions can introduce behavioural differences, new fields, updated metadata, which an integration may not be able to handle. The key point is that I've surrendered control over when I consume the new version.

When I use a fixed API version, upgrading is a planned event with testing. When I use latest, the upgrade comes as part of the release and the effort moves to my release preview testing. The responsibility to test still lies with me, all I've handed off is the decision to upgrade. 

When latest is greatest

Salesforce's recommendation is to use a fixed API version for production integrations dependent on a specific contract, while scripts and internal tools can work with latest. If this sounds like common sense, that's because it is. If your integration depends on something not changing, then don't allow that dependency to change! 

Fixed is the safe option?

Fixed certainly gives more control, but it can't really be described as truly safe. Once API v68.0 (Winter '27) went live, it actually impacted all earlier API versions. If you have an integration fixed at API v67.0 (Summer '26), Salesforce doesn't spin up a frozen-in-time Summer '26 release for you to work against. You hit the current, Winter '27, version of the platform which implements backward compatibility to preserve the contracted behaviour of API v67.0/Summer '26. So even if your REST API version doesn't change, the Salesforce platform you depend on does, and you should still regression test accordingly. 

Of course not many of us formally carry out this regression testing in preview sandboxes every release. Some of that is because Salesforce carry out extensive testing themselves, and they've got a good track record so we just trust them to get it right. Most of it, in my view anyway, is complacency! Salesforce releases don't feel like that kind of change - they are more like infrastructure maintenance than an application upgrade. Plus regression testing is expensive, and if nothing broke in the last 10 years it's easy to get lulled into a false sense of security?

Conclusion

So to sum up, feel free to use latest for things that aren't critical, but it's best to stick with fixed API versions for things that are critical. And if those things really are critical, make sure you regression test them every release regardless of which version they target.

More Information

Tuesday, 20 October 2026

Elastic Limits for Async Apex Jobs in Winter '27


Image generated by ChatGPT 5.6 Sol based on a prompt from Bob Buzzard

Introduction

The Summer '26 Salesforce release introduced the beta of elastic limits for asynchronous Apex Queueable and Future methods. It stays in beta in Winter '27, but extends the capability to Batch jobs. 

If you aren't familiar with this feature, it is essentially a safety net for when your asynchronous processing takes a hot turn and you suddenly find your system executing more jobs than governor limits allow. 

What's in a number?

Without elastic limits, as soon as you exceed the standard limit of

   max(250k, 200*applicable user licenses)

attempts to enqueue* additional jobs fail. 

With elastic limits you can continue to enqueue* jobs up to the additional elastic limit of

   min(2m, standard limit)

This isn't simply a doubling of the limit though - while that would be very cool for us, it would likely send a few Salesforce data centres into meltdown! Additional jobs enqueued* over the standard limit are subject to slowdown. Active job processing is throttled, and Batch jobs are limited to one active job at a time. 

How slow is slow?

Salesforce doesn't publish details of the throttling, which doesn't surprise me. This feature should be thought of as a safety net that makes use of spare capacity to help you avoid losing work. If the throttling algorithm were to be published, I'm pretty sure it would be widely misinterpreted as an SLA, with capacity planning based on behaviour that isn't contractual. 

The main thing to remember is that capacity is guaranteed, obviously up to the elastic limit, but throughput isn't. You can continue to enqueue* jobs, but you can't predict when they will execute, or when they will complete their processing. To be fair, if we take the Salesforce docs at their word, then this is no different to regular asynchronous processing:

Because many customers share available resources on each Salesforce instance, the exact execution timing of asynchronous requests cannot be predicted or guaranteed.

For the vast majority of scenarios this is fine. My experience is there are rarely delays (outside of service issues), and processing completing slightly later than expected typically has little to no business impact. If processing is really time-sensitive and mission-critical, we all know it should happen outside of Salesforce on infrastructure with guarantees. 

How can I tell I've hit the elastic?

There's a couple of ways to achieve this. 

The first is through the time-honoured mechanism of looking at a web page, the Apex Jobs setup page in this case:


The second, and probably more useful for developers, is using the OrgLimit class:

   Map<String,System.OrgLimit> limitsMap = OrgLimits.getMap();

// -- Standard Limits -- System.OrgLimit asyncApexDailyLimit = limitsMap.get('DailyAsyncApexExecutions'); // Total enqueued in last 24 hours Integer usedLimit=asyncApexDailyLimit.getValue(); // Daily limit Integer dailyLimit=asyncApexDailyLimit.getLimit(); // -- Elastic Limits -- System.OrgLimit asyncApexElasticLimit = limitsMap.get('DailyAsyncApexElasticExecutions'); // Total enqueued in last 24 hours - same as asyncApexDailyLimit.getValue() Integer elasticUsedLimit=asyncApexElasticLimit.getValue(); // Elastic limit Integer elasticDailyLimit=asyncApexElasticLimit.getLimit();

There's a couple of things to bear in mind here though:

  1. If you haven't enabled elastic limits, executing   
       limitsMap.get('DailyAsyncApexElasticExecutions')
    will return null

  2. For non-production orgs the standard + elastic limit is the same as the standard limit - only production orgs have additional capacity

No elastic in the schedule?

The eagle-eyed reader will have noticed that scheduled Apex is conspicuous by its absence. While the timeline so far might suggest it is coming in the next release, my own view is that this is rightly excluded. The elastic limit swaps timeliness for additional capacity - the benefit is the processing will complete eventually. Scheduled Apex requires timeliness - typically we schedule jobs to run at a particular time because that is when we need the processing to happen. 

Of course there are times when scheduled jobs just have to run at some point during a day, but to schedule them you have to choose a specific time. These jobs are candidates for elastic limits, but the problem is there's no way that Salesforce can know this. Luckily these jobs can just hand off to Queueable, Batch, or even Future if you are feeling retro, and take full advantage of the elastic capacity (such as it is).

*Enqueued or executed?

That's a great question, and one that I don't really have an answer to. The Salesforce docs seem to switch between executing and enqueuing jobs, and the Apex Jobs page throws processed into the mix, so I've continued with that. I assume that you won't be able to enqueue infinite jobs and there will only be exceptions when the executions exceed the elastic limit, but I'm not seeing that clearly called out in the docs. Remember that this is a beta feature - I'm sure by the time it becomes generally available the docs will have tightened up a little.

Conclusion

The main takeaway is that two times the asynchronous allowance doesn't mean two times the compute, or anything like it. This is a nice gesture from Salesforce that can really help with resilience, but if you are regularly exceeding the standard limit then it's worth investigating why and what you can do about it, even if that means offloading some processing elsewhere.

More Information