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;

global String convertedStatus;

global ID accountId;

global ID contactId;

global Boolean overWriteLeadSource;

global Boolean createOpportunity;

global String opportunityName;

global ID ownerId;

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?

1 Answer 1


Take a look at the V45.0 version of the doc

This looks more like what one would expect from the examples:

The data type of the invocable variable must be one of the following:

A primitive data type or a list of a primitive data type – the generic Object type is not supported.

An sObject type or a list of an sObject type – the generic sObject type is not supported.

Apex types were added in V46.0. There are a slew of examples of ApexTypes as return variables in this GitHub repo

  • So it seems that the newer version has the wrong data types Nov 6, 2019 at 12:54
  • @CommonCoreTawan - you should file doc feedback
    – cropredy
    Nov 6, 2019 at 19:36
  • do you know how? I don't have premier support. Basic support is allergic to the word "apex" Nov 7, 2019 at 12:27
  • There's a feedback button on the doc page
    – cropredy
    Nov 7, 2019 at 15:03
  • Thanks! will do Nov 7, 2019 at 15:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.