

Add Custom Icons to Apex-Defined Invocable Actions
As we know, Flows allow users to create complex business processes with a point-and-click interface. This reduces the dependency on developers for routine automation tasks, enabling administrators and business analysts to build solutions independently. Join us to learn about how to Add Custom Icons to Apex-Defined Invocable Actions.
What defines an Invocable Action?
Invocable actions in Salesforce Flows are particularly beneficial when you need to extend the capabilities of Flow Builder with custom Apex logic, handle complex data processing or integrations, implement advanced business rules, or optimise performance for batch operations. They bridge the gap between declarative and programmatic automation, enabling developers to leverage the strengths of both approaches effectively.
Steps to Add Invocable Action in Flow:
Use case: Send an email notification to the account owner requesting an update to the primary contact details.
- Define the Apex Class: Create an Apex class where you want to define the invocable method. Ensure the class is marked as public.
- Declare the Method: Declare a public static method that you want to expose as an invocable action. Use the @InvocableMethod annotation above the method definition.
public without sharing class AccountTriggerService { @InvocableMethod(label=’Send Email to update primary Contact’ category=’Account’) public static void sendEmail(List<Id> accountIds){ //code to send email } } |
- Now, create a new flow and add the Invocable action by selecting the invocable method label from Apex in the ‘Search Actions’.

This is how we can add Invocable Actions to flows. By the way, if you notice, the icon for these actions is currently a Lightning icon. This icon can be changed after the Summer ’22 release.
Now, add a custom icon to an Invocable Action:
To set a custom icon for your invocable action in Salesforce, you have two options.
- First one, you can upload a valid SVG file as a static resource.
- Second one, you can choose an icon from the Salesforce Lightning Design System (SLDS).
After selecting or uploading the icon, you need to set the iconName attribute in the @InvocableMethod annotation within your Apex class. When users add your invocable action in Flow Builder, the custom icon will be displayed on the Flow Builder canvas. This makes it easier for users to identify and locate your action within their flows.
Using a Salesforce Lightning Design System (SLDS) icons
@invocableMethod(label='Label of the Action' iconName='slds:category:name')
- When specifying an icon value for Salesforce Lightning Design System (SLDS) icons within Salesforce, it should adhere to a specific format.
- The value must begin with ‘slds’ followed by two parameters: ‘category’ and ‘name’.
- The ‘category’ refers to the type or classification of the icon, while the ‘name’ denotes the specific icon file within SLDS.
Example:
@InvocableMethod(label='Send Email to update primary Contact' category='Account' iconName='slds:custom:custom105')
Please refer to the image below to compare the custom icons used in Apex actions.

Similar way we can also use the SVG file as Custom Icon for the Apex Invocable action.
@invocableMethod(label='Label of the Action' iconName='resource:namespace__iconName:svgID')
- When specifying the SVG file as an invocable action, the iconName value should begin with ‘resource’ followed by three parameters.
- The ‘namespace’ parameter represents the namespace of the package containing the invocable action.
- If the action resides in a managed package, include the namespace followed by a double underscore (namespace__).
- The ‘iconName’ parameter specifies the name of the static resource uploaded to Salesforce, while ‘svgID’ refers to the ID attribute value of the SVG element within the file.
Example:
@InvocableMethod(label='myIcon' iconName='resource:myPackageNamespace__google:top')
SVG files must meet these requirements:
- The <svg> element in the file includes the id, xmlns, and viewBox attributes.
- The <svg> element in the file doesn’t include the style, height, and width attributes.
- The file doesn’t include a <clipPath> element.
- Each <path> element in the file includes a fill attribute.