So far, in the previous subsections, we explored how a Lightning Component can be part of the Flow builder. In this section, we will explore how you can embed the Flow inside a custom Lightning Component and pass variables in and out from the Flows to the custom Lightning Components.
To embed the Flow inside the Lightning Component, use the lightning:Flow tag and assign an aura:id. The following code snippet shows how to declare a markup that can render Flow inside the Lightning Component:
<aura:component> <aura:handler name="init" value="{!this}" action="{!c.init}"/> <lightning:Flow aura:id="myFlow" onstatuschange="{!c.handleStatusChange}" /></aura:component>
The JavaScript code to render the Flow ...