The documentation states the following
The data type of the invocable variable must be an Apex class or a list of Apex classes.
This is obviously 100% wrong because the same page lists a bunch of examples of primitive data types using the @InvocableVariable annotation
global ID leadId;
@InvocableVariable(required=true)
global String convertedStatus;
@InvocableVariable
global ID accountId;
@InvocableVariable
global ID contactId;
@InvocableVariable
global Boolean overWriteLeadSource;
@InvocableVariable
global Boolean createOpportunity;
@InvocableVariable
global String opportunityName;
@InvocableVariable
global ID ownerId;
@InvocableVariable
global Boolean sendEmailToOwner;
Also, in my org, I can use the annotation on a list of SObjects, even though this is not documented
@AuraEnabled @InvocableVariable
public List<OpportunityLineItem> lineItems;
That said, when I try to reference said variable in a Flow, I get an internal server error.
Does anyone know why the documentation is so outdated/wrong and which are the truly supported data types for this annotation?