Configure the Javascript Class for a Flow Local Action

When a component is executed as a flow local action, the flow calls the invoke method in the javascript class. To run the code asynchronously in your client-side component, such as when you're making an XML HTTP request (XHR), return a Promise. When the Promise is fulfilled, control is returned back to the flow.

When the Promise is resolved, the next element in the flow is executed. When the Promise is rejected or hits the timeout, the flow takes the local action's fault connector and sets the error message to $Flow.FaultMessage.

The default error message is An error occurred when the elementName element tried to execute the c-myComponent component. To customize the error message in $Flow.FaultMessage, return it as a new Error object in the reject() call.

If you’re making callouts to an external server, add the external server to the allowlist in your org and enable or configure CORS in the external server.

When the method finishes, the next element in the flow is executed.

See Also