See how to configure a Flow with process builder to execute an Apex method in Salesforce
As a thumb of rule in Salesforce you should always try to create new business logic through point-and-click but sometimes our logic it's a bit special and we need some Apex code.