Newer Version Available

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

Passing Data to a Flow Using the Process.Plugin Interface

Process.Plugin is a built-in interface that lets you process data within your org and pass it to a specified flow. The interface exposes Apex as a service, which accepts input values and returns output back to the flow.

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.

Tip

When you define an Apex class that implements the Process.Plugin interface in your org, it's available in Flow Builder as a legacy Apex action.

Process.Plugin has these top-level classes.

  • Process.PluginRequest passes input parameters from the class that implements the interface to the flow.
  • Process.PluginResult returns output parameters from the class that implements the interface to the flow.
  • Process.PluginDescribeResult passes input parameters from a flow to the class that implements the interface. This class determines the input parameters and output parameters needed by the Process.PluginResult plug-in.

When you write Apex unit tests, instantiate a class and pass it into the interface invoke method. To pass in the parameters that the system needs, create a map and use it in the constructor. For more information, see Using the Process.PluginRequest Class.