Newer Version Available

This content describes an older version of this product. View Latest

Apex Actions

Invoke Apex methods annotated with @InvocableMethod and include custom parameters with @InvocableVariable.

This object is available in API version 33.0 and later.

Supported REST HTTP Methods

URI
Get a list of available Apex actions:
/vXX.X/actions/custom/apex
Get information about a specific Apex action:
/vXX.X/actions/custom/apex/action_name
This example invokes the Apex method sampleApexAction, which takes a String parameter inputString:
/vXX.X/actions/custom/apex/sampleAction
Formats
JSON, XML
HTTP Methods
GET, HEAD, POST
Authentication
Authorization: Bearer token
Parameters
None
Notes
    • When invoking an Apex action using the POST method and supplying the inputs in the request, only the following primitive types are supported as inputs:
      • Blob
      • Boolean
      • Date
      • Datetime
      • Decimal
      • Double
      • ID
      • Integer
      • Long
      • String
      • Time
    • Describe and invoke for an Apex action respect the profile access for the Apex class. An error is issued if you don’t have access.
    • If you add an Apex action to a flow, and then remove the @InvocableMethod annotation from the Apex class, you’ll get a run-time error in the flow.
    • If an Apex action is used in a flow, packageable components that reference these elements aren’t automatically included in the package. For example, if you use an email alert, you must manually add the email template that is used by that email alert. To deploy the package successfully, manually add those referenced components to the package.
    • An Apex invocable action can be declared public or global in a managed package. However, that action won’t appear in the Cloud Flow Designer’s list of available actions while building or editing a flow. These invocable actions can still be referred to by flows within the same managed package. Global Apex invocable actions in a managed package can be used in flows outside the managed package, anywhere in the organization, and appear in the Cloud Flow Designer’s list of available actions to add to a flow.

Inputs

Apex actions do not have input values in the usual sense. Instead, you supply values that correspond to the InvocableVariables used by the Apex InvocableMethod you’re calling. For more information, see the InvocableMethod and InvocableVariable annotations in the Force.com Apex Code Developer’s Guide.

Outputs

Output values are determined by the Apex InvocableMethod you’re calling.