Example: SObject Collection Input for Invocable Actions
This example creates a custom property editor component named CreateAccountActionEditor for an invocable action that uses Account input parameters. In Flow Builder, an admin uses text fields to set the invocable action’s account input parameters. When users run a flow for this example, the invocable action creates a collection of accounts.
This Apex class file defines the CreateAccountAction method, which can run as an invocable action, and its input variables. The @InvocableMethod annotation identifies the method that can run as an invocable action. The @InvocableVariable annotation identifies the variables used by the invocable method.
The invocable method registers the custom property editor component in the configurationEditor modifier. For this example, the name of the component is c-create-accounts-action-editor.
The component namespace is c unless the org has a custom namespace. If the org has a custom namespace, use that namespace to register the custom property editor component.
Here’s the configuration file for CreateAccountAction.
These HTML, JavaScript, and configuration files define the custom property editor component CreateAccountActionEditor for the action.
The component’s HTML template defines the UI for the custom property editor in Flow Builder.
This example shows the custom property editor UI.

When the custom property editor component is initialized, the component instance receives a copy of the flow metadata from Flow Builder. When the admin changes a value in the custom property editor, the custom property editor component dispatches an event to propagate the change back to Flow Builder.
Use @api properties to capture data from flows. Use events to report changes to flows at run time.
Flow Builder has a JavaScript interface for communicating with a custom property editor. This JavaScript class uses the inputVariables interface.
When the custom property editor is initialized, inputVariables receives the value of the input variable in the invocable action from Flow Builder. When you use a literal value for an input that’s an sObject data type, specify the type value such as Account.
The newValue data structure includes the sObject type and field and value mappings in JSON format.
The get accounts() method gets the preexisting value for the input variable saved in flow metadata for use in the custom property editor.
When an admin enters a value for an input in the custom property editor, and clicks the Save button, the handleSaveAccountConfig method dispatches a configuration_editor_input_value_changed event to Flow Builder. Flow Builder receives the event and updates the value in the flow.
Here’s the configuration file for CreateAccountsActionEditor.
See Also