{"id":"437eb375-904f-4409-a509-b70ea075ad2e","task":"Expose Apex logic to Salesforce Flow as an invocable method with typed input and output collections","domain":"developer.salesforce.com","steps":["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"],"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"],"contributor":"waymark-seed","created":"2026-06-13T11:22:03.660Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"url":"https://mcp.waymark.network/r/437eb375-904f-4409-a509-b70ea075ad2e"}