---
schema_version: "1"
id: 146436f95e7b967bf72fa0df888015db08f15ca01103a8b9bf9e7942fd301235
title: Create Flow Local Actions Using Aura Components
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform/aura-platform/guides/aura/components/components-config-for-flow-actions.md
canonical_url: https://developer.salesforce.com/docs/platform/aura-platform/guide/components-config-for-flow-actions.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 690a5cd2f9885d34c51b40433d8975c3edc9284551cfcf91ff92ae6d86709075
products:
  - Lightning Aura Components Developer Guide
  - Platform Developer Content
---

# 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](https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/security_code.htm) restrictions.
- Flows that include Lightning components are supported only in [Lightning runtime](https://help.salesforce.com/articleView?id=flow_distribute_runtime.htm).
- 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.

```nolang
<aura:component implements="lightning:availableForFlowActions" access="global">
    <aura:attribute name="greeting" type="String" default="Hello" access="global" />
    <aura:attribute name="subject" type="String" default="World" access="global" />
</aura:component>
```

```javascript
({
  // When a flow executes this component, it calls the invoke method
  invoke: function (component, event, helper) {
    alert(component.get("v.greeting") + ", " + component.get("v.subject"));
  },
});
```

- **[Configure the Component Markup and Design Resource for a Flow Action](https://developer.salesforce.com/docs/platform/aura-platform/guide/components-config-for-flow-actions-markup.md)**


    Make your custom Aura components available as flow local actions by implementing the `lightning:availableForFlowActions` interface.

- **[Configure the Client-Side Controller for a Flow Local Action](https://developer.salesforce.com/docs/platform/aura-platform/guide/components-config-for-flow-actions-controller.md)**


    When a component is executed as a flow local action, the flow calls the `invoke` method 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](https://developer.salesforce.com/docs/platform/aura-platform/guide/components-config-for-flow-actions-abort.md)**


    If an asynchronous request times out, the flow executes the local action's fault connector and sets `$Flow.FaultMessage` to the error message. However, the original request isn't automatically canceled. To abort an asynchronous request, use the `cancelToken` parameter available in the `invoke` method.

**See Also**

- [_Component Library_: lightning:availableForFlowActions Interface](https://developer.salesforce.com/docs/component-library/bundle/lightning:availableForFlowActions/documentation)

- [_Security for Lightning Components:_ Lightning Locker](https://developer.salesforce.com/docs/platform/lightning-components-security/guide/locker_intro.html)

- [Customize Flow Screens Using Aura Components](https://developer.salesforce.com/docs/platform/aura-platform/guide/components-config-for-flow-screens-intro.md)
