Sometimes, automating the process using Salesforce flow can be limited by the capabilities for handling complex logic. So, for that, we can use an apex class to automate the process and then call an apex class from a flow.
In this Salesforce tutorial, we will learn how to call an Apex class from Salesforce flow. In this, I will explain what an invocable method is; then, we will create an Apex class and call that Apex class in the flow.
What is the Invocable Method in Salesforce?
To call Apex code from a flow, we need to create an Invocable method within the Apex class. This method is annotated with @InvocableMethod, which makes it