Invocable Apex actions in Flow Builder
Key Takeaway
An Apex action is where a declarative build hands off to programmatic code: a developer writes the Apex, and you call it from the flow.
An Apex action lets a flow call Apex code that a developer wrote, for work that Flow Builder's standard elements can't do. You add it to the flow as an Action element, pass values in, and use the values that come back.
When a flow needs an Apex action
Flow Builder covers a lot without code. When a flow needs functionality beyond the standard elements, you call an Apex class from the flow by using an Apex action. The Apex action is where a declarative build hands off to programmatic code.
An Apex class works as an Apex action only if one of its methods has the @InvocableMethod annotation. A developer marks the method with this annotation and makes the class available. In Flow Builder, you then select the action and map its inputs and outputs.