Skip to content

Leaving Salesforce

Module 1 of 8 in the chapter Salesforce as an API Consumer, chapter 9 of the Integration Architect course. Each module stands on its own. Next: The Six Lines of a Callout

The question this module answers: What are all the ways out of Salesforce, and what do you need before anything can leave?

Chapter 8 was every way into Salesforce. Now we flip the script. We’re inside Salesforce, and we’re the ones making the call.

It starts with an action. An opportunity closes, a delivery is marked delivered, somebody presses a button, a scheduled job wakes up at two in the morning. Something happens, and we need to leave Salesforce and go to another server. We might go to tell it something, to ask it something, or to push or pull data. And the limits on reaching out of Salesforce are a whole different set from the limits on reaching in.

Salesforce Won’t Let You Leave Until You Approve It

Section titled “Salesforce Won’t Let You Leave Until You Approve It”

Salesforce blocks outbound calls. You cannot leave Salesforce and make an outbound call unless you approve it. That’s a good thing. Code, a flow or an AI agent can’t quietly send your data anywhere it likes.

You approve the way out with a named credential, the gate you met in chapter 4. Every way out, in clicks or in code, goes through the same gate. You’ll still find the older approval, remote site settings, in many orgs; it only holds the address, and chapter 17 (coming soon) tells its history.

Three Things You Need to Reach Another System

Section titled “Three Things You Need to Reach Another System”

To reach any other system, you need to know three things.

  1. The location. Where is it? Its address: the URL, the port.
  2. The credentials. How do I prove who I am? A token, a key, a certificate.
  3. The functions. How do I talk to it? Is it REST, or SOAP? Which verbs, which addresses, what do I send and what comes back?

A remote site setting only gave you the first. A named credential gives you the first two: the location and the way to sign in. The third is yours. It’s the contract from chapter 3, and the rest of this chapter is about calling it well.

When I teach this, I put up a road map of leaving Salesforce: every way out on one page. It’s the mirror of chapter 8’s map of the ways in, and it’s built the same way. Each set is named for what Salesforce is doing, and every way out says where in the course it’s taught.

The ways out of Salesforce, in sets The ways out of Salesforce, in seven sets, one per row, named for what Salesforce is doing. Calls out, in code, where Apex makes the call: the HTTP callout, chapter 9 modules 2 to 5; a continuation, for a long wait from a page, module 5; and the SOAP callout from a WSDL, legacy, chapter 17. Calls out, in clicks, where a flow makes the call: the Flow HTTP callout, chapter 4 module 3 and chapter 9 module 5; External Services, chapter 4 module 2 and chapter 9 module 5; and invocable Apex, a flow calling your code, chapter 9 module 5. Publishes, and others subscribe, where nobody calls anyone: platform events, chapters 4 and 11; Change Data Capture, chapter 11; and Event Relay, events to Amazon EventBridge, chapter 11. Pushes the old way: outbound messages, legacy, chapter 9 module 7 and chapter 17. Shows outside data without copying it: Salesforce Connect, chapter 19. Agents call out: agent actions and the MCP client, chapter 22. Connects Salesforce's own products: product connectors, chapters 18 and 20. Blue ways are taught in this chapter, slate in another chapter, amber are legacy. Underneath: every callout, in code or in clicks, goes through one gate, a named credential. {"author": "Steve Simpson", "blueprint": "1.0.1", "builder": "standard 1.58.0", "built": "2026-11-03", "id": "DGM-INT-SC-01", "rights": "\u00a9 2026 Twinshark LLC. All rights reserved.", "template": "cells 0.5.0", "theme": "stevetecharc 1.4.0"} THE SET: WHAT SALESFORCE IS DOING THE WAYS OUT Calls out, in code Apex makes the call HTTP callout REST, the six lines · ch 9.2–9.5 Continuation a long wait from a page · ch 9.5 SOAP callout from a WSDL for older systems · ch 16 Calls out, in clicks a flow makes the call Flow HTTP callout from a sample · ch 4.3, 9.5 External Services from the contract · ch 4.2, 9.5 Invocable Apex a flow calls your code · ch 9.5 Publishes; others subscribe nobody calls anyone Platform events your event, your fields · ch 4.5, 11 Change Data Capture every change, automatically · ch 11 Event Relay events to Amazon EventBridge · ch 11 Pushes the old way Salesforce's own queue Outbound messages SOAP, from a flow · ch 9.7, 16 Shows outside data, without copying it read where it lives Salesforce Connect external objects · ch 18 Agents call out AI as the caller Agent actions Apex, flows, External Services · ch 21 MCP client an agent calls outside tools · ch 21 Connects Salesforce's own products built for you Product connectors to Salesforce's other clouds · ch 17, 19 Every callout, in code or in clicks, goes through one gate: a named credential (chapter 4). HOW TO READ IT taught in this chapter taught in another chapter legacy: still there, not for new work © 2026 Twinshark LLC · stevetecharc.com
Click to enlarge

The ways out of Salesforce, in sets. Blue is this chapter.

Read the sets as different ideas, not just different tools:

  • Calls out, in code or in clicks: Salesforce starts the conversation and reaches the other system directly. This chapter is mostly about these.
  • Publishes; others subscribe: Salesforce doesn’t call anyone. It puts an event on the bus, and whoever cares comes and gets it (chapter 11).
  • Pushes the old way: outbound messages, Salesforce’s own queue that delivers to a listener you build. It’s an old car that’s still running, and module 7 covers it.
  • Shows outside data without copying it: Salesforce Connect reads the data where it lives (chapter 19 (coming soon)).
  • Agents call out: an agent’s actions are flows, Apex or External Services, and Agentforce can now call outside tools as an MCP client (chapter 22 (coming soon)).
  • Connects Salesforce’s own products: the connectors to Salesforce’s other clouds, built for you.

The same news can leave Salesforce in more than one way. Take Steve Trucking’s delivery status. In chapter 4, a few lines of Apex told Redrock directly that a delivery was made: calls out, in code. In Checkpoint 1, the design changed: Salesforce publishes one status event, and the integration layer delivers it to every partner in the way each one wants: publishes, and others subscribe. Same news, two sets on the map.

So how do you choose? When I walk through the options for telling another system that a record changed, I come back to three questions:

  • What can the other system do? Can it subscribe to Salesforce’s events, or does it only expose a web service you have to call? If it only takes calls, you’re calling out.
  • Is there something in the middle? If you have an integration layer, it can play any of these parts: subscribe to the events, expose an address, make the call. Then Salesforce often only needs to publish.
  • Where should the logic live, and who will look after it? Clicks are simpler, but they may not handle complicated mapping or intricate steps. Code has more complexity, but it can handle more. Choose by the skills of the team that will own it, not only the team that builds it.

In early 2024 I made a video on eight ways to tell another system that a record changed, in configuration and in code, and how to choose between them. The note under the video says what’s still right and what’s changed since.

STA 1.24 · Integration Patterns: Options for Achieving Near-Real-Time Notifications to External Systems · 8:54 · published 2024-01-22 · plays from YouTube when you click it · Watch on YouTube · More videos: Salesforce Integration Architecture Videos
  • The set, before the tool. For each arrow leaving Salesforce: does Salesforce call, publish, push, show, or let an agent call? The pattern from chapter 7 usually answers this.
  • The three things, written down. The location, the credentials and the functions for every system you call, before anyone builds.
  • The gate. Every way out through a named credential; any remote site setting you find, on a list to replace.
  • Clicks or code. By what the other system can do, what’s in the middle, and who will own the logic.