Salesforce Dictionary - Free Salesforce GlossarySalesforce Dictionary
Salesforce Developer
easy

What is Salesforce Functions / Heroku integration?

Salesforce Functions (now retired/in transition; Heroku Apps remain the path) let you offload compute-heavy work to Heroku containers running outside Salesforce, callable from Apex.

Why: governor limits cap Apex compute (10s CPU sync, 60s async, 6 MB heap). Heavy work (large image processing, ML inference, complex algorithms, data transformations) doesn't fit. Functions/Heroku run server-side in Node/Python/Java/Go without those caps.

Pattern:

  1. Build a Function/Heroku app — accept HTTP POST, do heavy work, return JSON.
  2. Deploy via Heroku CLI or Salesforce Functions tooling.
  3. Connect Salesforce to Heroku via Salesforce Connect or Heroku Connect (data sync).
  4. Apex calls the function via HTTP callout (Named Credential).

apex HttpRequest req = new HttpRequest(); req.setEndpoint('callout:Heroku_App/generate-pdf'); req.setMethod('POST'); req.setBody(JSON.serialize(payload)); HttpResponse res = new Http().send(req);

When to use: image manipulation, PDF generation at scale, ML model inference, complex calculations beyond governor limits, integrations needing libraries Apex doesn't have.

Salesforce's specific "Functions" product had a complicated history; modern guidance is "use Heroku directly" or evaluate Salesforce's evolving compute offerings.

Why this answer works

Tests integration depth. Most devs haven't used Functions; mentioning it shows breadth even if you'd default to Heroku/REST.

Follow-ups to expect

Related dictionary terms