Get Started with External Services
After completing this unit, you’ll be able to:
- Explain what an external service is.
- Identify use cases for external services.
- Describe the high-level flow of an external service.
Why External Services?
- Make your new Salesforce org users automatic collaborators for external, org-related applications. Maybe you want users to have access to a payroll information app so that they can look up their own timesheet and pay data. You can register an external service and create a flow with triggers that takes inputs such as user ID. When you create a user, the triggers fire and add the user as a collaborator who has access to the payroll app.
- Connect to a credit service that determines if credit is extended to an account in your org. You can register your external service and create a flow that includes inputs like order amount and credit terms. When the flow runs, it updates the credit terms for the order associated with the account.
Let’s move on to learn more detail about what External Services is.
What Is External Services?
With External Services, you use declarative tools to import Swagger or Interagent-based API definitions right into Salesforce using a schema. Once you import the definitions, you can create a flow based on the Apex classes generated from your External Services registration...
While these terms—Swagger and Interagent definitions, API, and Schema—are geared toward developers, we don’t leave admins in the lurch. In the coming units, we walk you through a schema definition, help you use declarative tools to register an external service, and get you going on creating a simple flow, so hang on.
- An external services provider, such as a bank, shares its REST-based API schema specification. (If you don’t know what REST is, that’s OK.) Think of this specification as a type of technical contract.
- Based on the specification, a developer (or maybe even you) creates a schema definition that describes the API.
- A Salesforce administrator declaratively creates a named credential to authenticate to the service’s endpoint using the URL provided by the external service provider. The endpoint is simply what exposes the web services resources that External Services needs to interact with.
- A Salesforce administrator declaratively registers the service and uses both the named credential and schema definition during the registration process. External Services automatically imports the definitions into your org and generates Apex actions, which are available immediately in Lightning Flow.
- A Salesforce administrator declaratively creates a flow using the External Services–generated Apex actions.
- Users run the flow. During runtime, External Services sends a callout to the service’s endpoint. The service returns output based on the schema definition.
- Data is retrieved, created, updated, or deleted.