Using the Process.PluginDescribeResult Class

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.
Tip

Tip

We recommend using the @InvocableMethod annotation instead of the Process.Plugin interface.

  • The interface doesn’t support Blob, Collection, sObject, and Time data types, and it doesn’t support bulk operations. Once you implement the interface on a class, the class can be referenced only from flows.
  • The annotation supports all data types and bulk operations. Once you implement the annotation on a class, the class can be referenced from flows, processes, and the Custom Invocable Actions REST API endpoint.

The Process.PluginDescribeResult class doesn’t support the following functions.

Process.PluginDescribeResult Class and Subclass Properties

Here’s the constructor for the Process.PluginDescribeResult class.
Process.PluginDescribeResult classname = new Process.PluginDescribeResult(); 
Here’s the constructor for the Process.PluginDescribeResult.InputParameter class.
Process.PluginDescribeResult.InputParameter ip = new 
    Process.PluginDescribeResult.InputParameter(Name,Optional_description_string, 
      Process.PluginDescribeResult.ParameterType.Enum, Boolean_required);
Here’s the constructor for the Process.PluginDescribeResult.OutputParameter class.
Process.PluginDescribeResult.OutputParameter op = new 
    new Process.PluginDescribeResult.OutputParameter(Name,Optional description string, 
       Process.PluginDescribeResult.ParameterType.Enum);
To use the Process.PluginDescribeResult class, create instances of these subclasses.
Process.PluginDescribeResult.InputParameter is a list of input parameters and has the following format.
Process.PluginDescribeResult.inputParameters = 
      new List<Process.PluginDescribeResult.InputParameter>{ 
         new Process.PluginDescribeResult.InputParameter(Name,Optional_description_string, 
      Process.PluginDescribeResult.ParameterType.Enum, Boolean_required)
For example:
Process.PluginDescribeResult result = new Process.PluginDescribeResult(); 
result.setDescription('this plugin gets the name of a user');
result.setTag ('userinfo');
result.inputParameters = new List<Process.PluginDescribeResult.InputParameter>{ 
    new Process.PluginDescribeResult.InputParameter('FullName', 
       Process.PluginDescribeResult.ParameterType.STRING, true),
    new Process.PluginDescribeResult.InputParameter('DOB', 
       Process.PluginDescribeResult.ParameterType.DATE, true),
    }; 
Process.PluginDescribeResult.OutputParameter is a list of output parameters and has the following format.
Process.PluginDescribeResult.outputParameters = new List<Process.PluginDescribeResult.OutputParameter>{ 
    new Process.PluginDescribeResult.OutputParameter(Name,Optional description string, 
       Process.PluginDescribeResult.ParameterType.Enum)
For example:
Process.PluginDescribeResult result = new Process.PluginDescribeResult(); 
result.setDescription('this plugin gets the name of a user');
result.setTag ('userinfo');
result.outputParameters = new List<Process.PluginDescribeResult.OutputParameter>{
    new Process.PluginDescribeResult.OutputParameter('URL', 
        Process.PluginDescribeResult.ParameterType.STRING),
Both classes take the Process.PluginDescribeResult.ParameterType Enum. Valid values are:
For example:
Process.PluginDescribeResult result = new Process.PluginDescribeResult(); 
        result.outputParameters = new List<Process.PluginDescribeResult.OutputParameter>{
            new Process.PluginDescribeResult.OutputParameter('URL', 
            Process.PluginDescribeResult.ParameterType.STRING, true),
            new Process.PluginDescribeResult.OutputParameter('STATUS', 
            Process.PluginDescribeResult.ParameterType.STRING),
            };