Salesforce Functions: Deliver even better, integrated solutions with a new Salesforce feature
twitter social iconlinkedin social iconfacebook social icon

Salesforce Functions: Deliver even better, integrated solutions with a new Salesforce feature

By Harm Korten

In the past few weeks, Appsolutely had the pleasure to participate in both the pilot and the beta for an upcoming, new Salesforce feature. Salesforce Functions will transform the way developers and architects design solutions for the Salesforce platform. With this feature, users deliver functionalities written in coding languages other than Apex. It also provides them with the possibility to host solutions outside of the Salesforce platform, yet in a much more integrated way than simply developing them on an external web service. Read on to learn more about the functionalities and discover some clever use cases.

How it works: Multiple coding languages and ran in a Salesforce-managed compute environment

The code will run in a so-called compute environment, a Salesforce-managed infrastructure hosted on Heroku. It can be used on the Salesforce platform with simple Apex statements and the response will be in the form of JSON. A function can be called both synchronously and asynchronously. Parameters can be passed to the function as a JSON object. Below, you find an example.

The function itself, whether it is in Java or in Node.js, will receive the invocation, which includes an API access token that allows the function to callback to the Salesforce API, along with other contextual data and a logging interface. It can be tested locally by running it in a Docker container. Development is done in a Salesforce DX project, leveraging the already familiar Salesforce CLI. Currently, Node.js and Java are supported in Salesforce Functions, but we expect to see support for other languages in the future.

How will Salesforce Functions improve your solution development?

The most prominent use case of Salesforce Functions will certainly be that you can now avoid hitting governor limits by moving complex, memory-intensive and long running processes off the platform, out of the Salesforce transaction, and onto the secure managed compute environment. Salesforce orgs that are struggling with big numbers of chained business processes (e.g. Apex triggers and process flows) in a single transaction may consider moving some of these processes to Salesforce Functions and thereby avoid the dreadful governor limits.
On top of that, Salesforce Functions may open up the world of Salesforce development to developers with a skillset in other programming languages than Apex and offer architects more options to orchestrate solutions.
With Salesforce Functions the possibilities of Salesforce development will become more accessible to developers that are used to working in a multitude of programming languages.
Another use case would be to use Functions as a replacement for web service solutions. Because functions are more strongly (and securely) tied to Salesforce, a lot of overhead is saved. For example, the invoking Apex does not need to set up the full HTTP request and the service logic itself does not need to implement authentication logic with Salesforce to make callbacks. Other practical use cases include, for example, document generation, processing large files (like bank tapes, for example), image processing, compressing files and off-platform AI. And that’s just to name a few.

Already a significant increase in handling capacity, despite some limits

Although the final implementation of Functions may still change from the beta, we already know there will be some limitsBesides the limits to the current request and response size, the most interesting one from a design perspective is the process memory limit. The new limit of 1 GB, which will most likely be increased to 3 GB in the future, already offers a significant increase of the handling capacity compared to solely using Apex. Apex maximum heap size currently stands at 12 MB and is shared with all other processes in the same transaction. It’s easy to see that 1 GB allows for much more elaborate processing, and a future increase to 3 GB would improve the handling capacity even more.

Salesforce Functions will be another tool in the already rich toolbox of the Salesforce platform and may become a game changer for the whole concept of Salesforce development. At Appsolutely, we’re enthusiastically awaiting the final version! The GA release of the feature will happen during Salesforce’s winter release.
Interested in Salesforce Functions? Get in touch! We’ll get you up to speed.

Get to know Harm

With 17 Salesforce certificates and more than 15 years of experience working with Salesforce in various capacities, Harm is a true fan! Harm has worked on well over a hundred Salesforce projects of varying sizes and scopes. As an authorized Salesforce trainer, Harm has delivered many technical Salesforce courses between 2009 and 2016. Harm's specialties are Salesforce solution architecture, (Apex) development and system integration; the latter two being personal favorites. 

Outside technology, Harm enjoys computer games, chess, football, and time with his two daughters.

Have a look at our open positions if you’re a fan like Harm!

Share this article:
twitter social iconfacebook social iconlinkedin social icon

divider graphic


Product customizability and Overridable flows: Giving the controls to the customer
September 20, 2022

Product customizability and Overridable flows: Giving the controls to the customer

By: Hugo van Krimpen When developing Salesforce products for the AppExchange, we regularly face requ...

Hugo van Krimpen
By Hugo van Krimpen
Partner Event: Future-Proof Service Operations 2022
September 4, 2022

Partner Event: Future-Proof Service Operations 2022

Future-Proof Service Operations How to extend your service operations to sales, marketing, and beyon...

Luuk Timmermans
By Luuk Timmermans
Why you should stop just creating code!
August 10, 2022

Why you should stop just creating code!

By: Rodrigo Dantas Deep dive on Software Best Practices, and what we saw at TDX22 that backs up this ...

Rodrigo Dantas
By Rodrigo Dantas