Annotate a global or public static Apex method with @InvocableMethod(label='...' description='...' category='...')
Define an inner class annotated with nothing (plain Apex class) to serve as the request type, with each field annotated @InvocableVariable(label='...' required=true/false)
Define a corresponding response inner class with @InvocableVariable-annotated output fields that the flow will read after execution
Declare the method signature as List<ResponseClass> methodName(List<RequestClass> requests) — Flow always passes a list to support bulk invocation
Process all items in the input list in a single method call, using bulkified SOQL and DML as needed, and return a list of responses in the same order as inputs
In Flow Builder, add an Action element, search for the invocable method by its label, map flow variables to input fields, and map output fields back to flow variables
Known gotchas
The method must accept exactly one List parameter and return exactly one List — methods with signatures that deviate from this pattern will not surface in Flow Builder's Action picker
Each input and output field on the inner classes must be a supported Flow data type; unsupported types (e.g., Map, Set, custom non-sObject objects not annotated) cause compile-time or runtime errors
Invocable methods called from a Record-Triggered Flow share the triggering transaction's governor limits; heavy Apex logic inside the method can exhaust SOQL or CPU limits on large bulk operations
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp