In this Integration pattern, Salesforce need to wait for response to complete the process.
Solutions:
- External Services (Best Solution):
Point & Click based integration from Lightning Flow. External System should provide Open API or should have extragent schema.
Click this for trailhead Exercise.
- LWC or Visualforce calling External System (Best Solution):
Salesforce enables you to consume a WSDL and generate a resulting proxy Apex class. A user-initiated action on a Visualforce page or Lightning page then calls an Apex controller action that then executes this proxy Apex class to perform the remote call.
Salesforce also enables you to invoke HTTP (REST) services using standard GET, POST, PUT, and DELETE methods.
Note: If the remote endpoint poses a risk of high latency response, then an asynchronous callout, also called a continuation, is recommended to avoid hitting synchronous Apex transaction governor limits.
- Trigger (Sub-Optimal Solution):
You can use Apex triggers to make callouts to external system based on record data changes.
An Apex proxy class can be executed as the result of a DML operation by using an Apex trigger. However, all calls made from within the trigger context must execute asynchronously from the initiating event. Therefore, this solution isn’t recommended for this integration problem. This solution is better suited for the Fire & Forget pattern.
- Batch Apex calling External Services (Sub-Optimal Solution):
You can make calls to a remote system from a batch job. This solution allows batch remote process execution and processing of the response from the remote system in Salesforce. However, a given batch has limits to the number of calls. For more information, see Governor Limits.
A given batch run can execute multiple transaction contexts (usually in intervals of 200 records). The governor limits are reset per transaction context.
For all Design Patterns, please refer this.