Process Builder allows you to call an Apex class that includes methods annotated with @InvocableMethod. By calling an Apex class from Process Builder, you can add customized functionality such as, auto-converting leads, deleting records, or running lead assignment rules from Process Builder. You can also pass the required value into Apex class variables.
When no other process actions can get your job done, by calling an Apex method, you add customized functionality to your users. You can only call an Apex class from Process Builder or Visual Workflow that have the @InvocableMethod annotation. This means that it is possible to extend the Process Builder functionality by writing an Apex class that executes your business logic and then invoking the Apex from your process. If the class contains one or more invocable variables, then you have to manually enter values...