Newer Version Available
Create Flow Local Actions Using Lightning Components
To execute client-side logic in your flow, build or modify custom Lightning 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
Lightning component’s markup, client-side controller, and design resource, it appears in the Cloud
Flow Designer as a Local Action element.
Example
Here’s a sample “c:helloWorld” component and its client-side controller, which triggers a JavaScript alert that says Hello, World. In the Cloud Flow Designer, local actions appear as Local Action elements.
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})