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.
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.
-
Configure the Component Markup and Design Resource for a Flow Action
Make your custom Aura components available as flow local actions by implementing the
lightning:availableForFlowActionsinterface. -
Configure the Client-Side Controller for a Flow Local Action
When a component is executed as a flow local action, the flow calls the
invokemethod in the client-side controller. To run the code asynchronously in your client-side controller, such as when you’re making an XML HTTP request (XHR), return a Promise. When the method finishes or the Promise is fulfilled, control is returned back to the flow. -
Cancel an Asynchronous Request in a Flow Local Action
If an asynchronous request times out, the flow executes the local action’s fault connector and sets
$Flow.FaultMessageto the error message. However, the original request isn’t automatically canceled. To abort an asynchronous request, use thecancelTokenparameter available in theinvokemethod.
See Also