Use the Process.Plugin interface describe method to dynamically provide both input and output parameters for the flow. This method returns the Process.PluginDescribeResult class.
We recommend using the @InvocableMethod annotation instead of the Process.Plugin interface.
The interface doesn’t support Blob, Collection, and sObject, data types, and it doesn’t support bulk operations. After you implement the interface on a class, the class can be referenced only from flows.
The annotation supports all data types and bulk operations. After you implement the annotation on a class, the class can be referenced from flows, processes, and the Custom Invocable Actions REST API endpoint.
Legacy Apex actions aren’t supported in auto-layout in Flow Builder. Legacy Apex actions are only available to be added in free-form in Flow Builder. Existing actions can be edited in both auto-layout and free-form mode.
You can customize how invocable actions created with @InvocableMethod appear in Flow Builder by using the InvocableActionExtension metadata file. Control parameter order, add picklists, create custom headers, and build partial custom property editors.
Tip
The Process.PluginDescribeResult class doesn’t support the following functions.
Queries
Data modification
Email
Apex nested callouts
Process.PluginDescribeResult Class and Subclass Properties
Here’s the constructor for the Process.PluginDescribeResult class, where classname is a placeholder value.
1Process.PluginDescribeResult classname = new Process.PluginDescribeResult();
Here’s the constructor for the Process.PluginDescribeResult.InputParameter class, where ip, Name, Optional_description_string, Enum, and Boolean_required are placeholder values.
1Process.PluginDescribeResult.InputParameter ip = new2 Process.PluginDescribeResult.InputParameter(Name,Optional_description_string,3 Process.PluginDescribeResult.ParameterType.Enum, Boolean_required);
Here’s the constructor for the Process.PluginDescribeResult.OutputParameter class, where op, Name, Optional description string, and Enum are placeholder values.
1Process.PluginDescribeResult.OutputParameter op = new2 new Process.PluginDescribeResult.OutputParameter(Name,Optional description string,3 Process.PluginDescribeResult.ParameterType.Enum);
To use the Process.PluginDescribeResult class, create instances of these subclasses.
Process.PluginDescribeResult.InputParameter
Process.PluginDescribeResult.OutputParameter
Process.PluginDescribeResult.InputParameter is a list of input parameters and has this format, where Name, Optional_description_string, Enum, and Boolean_required are placeholder values.
1Process.PluginDescribeResult.inputParameters =2 new List<Process.PluginDescribeResult.InputParameter>{3 new Process.PluginDescribeResult.InputParameter(Name,Optional_description_string,4 Process.PluginDescribeResult.ParameterType.Enum, Boolean_required)
For example:
1Process.PluginDescribeResult result = new Process.PluginDescribeResult();2result.setDescription('this plugin gets the name of a user');3result.setTag('userinfo');4result.inputParameters = new List<Process.PluginDescribeResult.InputParameter>{5 new Process.PluginDescribeResult.InputParameter('FullName',6 Process.PluginDescribeResult.ParameterType.STRING, true),7 new Process.PluginDescribeResult.InputParameter('DOB',8 Process.PluginDescribeResult.ParameterType.DATE, true),9};
Process.PluginDescribeResult.OutputParameter is a list of output parameters and has this format, where Name, Optional description string, and Enum are placeholder values.
1Process.PluginDescribeResult.outputParameters = new List<Process.PluginDescribeResult.OutputParameter>{2 new Process.PluginDescribeResult.OutputParameter(Name,Optional description string,3 Process.PluginDescribeResult.ParameterType.Enum)
For example:
1Process.PluginDescribeResult result = new Process.PluginDescribeResult();2result.setDescription('this plugin gets the name of a user');3result.setTag('userinfo');4result.outputParameters = new List<Process.PluginDescribeResult.OutputParameter>{5 new Process.PluginDescribeResult.OutputParameter('URL',6 Process.PluginDescribeResult.ParameterType.STRING),
Both classes take the Process.PluginDescribeResult.ParameterType Enum. Valid values are:
BOOLEAN
DATE
DATETIME
DECIMAL
DOUBLE
FLOAT
ID
INTEGER
LONG
STRING
TIME
For example:
1Process.PluginDescribeResult result = new Process.PluginDescribeResult();2 result.outputParameters = new List<Process.PluginDescribeResult.OutputParameter>{3 new Process.PluginDescribeResult.OutputParameter('URL',4 Process.PluginDescribeResult.ParameterType.STRING, true),5 new Process.PluginDescribeResult.OutputParameter('STATUS',6 Process.PluginDescribeResult.ParameterType.STRING),7};