Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
Create Flow Local Actions Using Aura Components
To execute client-side logic in your flow, build or modify custom Aura components to use
as local actions in flows. For example, get data from third-party systems without going through
the Salesforce server, or open a URL in another browser tab. Once you configure the Aura
component’s markup, client-side controller, and design resource, it’s available in Flow Builder as
a Core Action element.
- Lightning components in flows must comply with Lightning Locker restrictions.
- Flows that include Lightning components are supported only in Lightning runtime.
- Lightning components require a browser context to run, so flow action components are supported only in screen flows.
Example
Here’s a sample “c:helloWorld” component and its client-side controller, which triggers a JavaScript alert that says Hello, World. In Flow Builder, local actions are available from the Core Action element.
1<aura:component implements="lightning:availableForFlowActions" access="global">
2 <aura:attribute name="greeting" type="String" default="Hello" access="global" />
3 <aura:attribute name="subject" type="String" default="World" access="global" />
4</aura:component>1({
2 // When a flow executes this component, it calls the invoke method
3 invoke : function(component, event, helper) {
4 alert(component.get("v.greeting") + ", " + component.get("v.subject"));
5 }
6})