10

I know it's possible to launch a flow from Aura components, I'd like to know if this can also be done from a LWC.

Please note that I'm not trying to add a LWC into a screen flow - which is an upcoming feature in Winter '20.

So is this possible, and if not, are there any workarounds (aside from building the component using Aura)?

Any help would be much appreciated.

2 Answers 2

10

No. As of today its not available. You can keep checking the documentation Base Components: Aura Vs Lightning Web Components to know:

The table lists usage differences between Aura base components and their Lightning web component counterparts.

5
  • Thanks for the info
    – M H
    Commented Sep 20, 2019 at 2:47
  • Are there any decent workarounds that you could suggest?
    – M H
    Commented Sep 20, 2019 at 2:48
  • 2
    the simplest would be to wrap LWC comp in aura comp, fire custom event from lwc which will be taken care by aura to launch Commented Sep 20, 2019 at 3:13
  • By the way, this worked like a charm, thanks
    – M H
    Commented Dec 31, 2019 at 0:23
  • @MH can you provide an answer with an example of your workaround? Commented Jun 10, 2020 at 5:07
1

With the Winter '23 release (56), we can now use the lightning-flow component.

The lwc's html would use it as:

<template>
    <lightning-flow
        flow-api-name="Survey_customers"
        flow-input-variables={inputVariables}
        onstatuschange={handleStatusChange}
    >
    </lightning-flow>
</template>

If youre retooling an existing lwc, you may need to update the api version in the lwc's metadata file to use a feature of a new version:

<apiVersion>56.0</apiVersion>

Here's some docs I could find:

lightning-flow: https://developer.salesforce.com/docs/component-library/bundle/lightning-flow/documentation

release note: https://help.salesforce.com/s/articleView?id=release-notes.rn_automate_flow_builder_lwc_launch_screen_flows.htm&release=240&type=5

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .