I have quick action that opens a flow in a modal. I have a lwc component that displays a toast message upon the last screen of the flow. I'm trying to auto close the modal upon reaching the finish screen using CloseActionScreenEvent, but the modal isn't closing when the finish screen is reached.

Here is the code in the js controller:

import { LightningElement, api } from 'lwc';
import { FlowNavigationNextEvent, FlowNavigationFinishEvent } from "lightning/flowSupport";
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import { NavigationMixin } from 'lightning/navigation';
import { CloseActionScreenEvent } from 'lightning/actions';
export default class flowScreen_displayToastMessage extends NavigationMixin(LightningElement) {
    hasRendered = false;
    @api recordId;
    @api objectApiName;
    @api title;
    @api variant;
    @api message;
    @api urlLabel;
    @api triggerNavigationNextEvent;
    availableActions = [];
    renderedCallback() {
        if (!this.hasRendered) {
            this.hasRendered = true;
    async showToastMessage() {
    // ...<code removed for brevity>...
        if (this.triggerNavigationNextEvent) {
            if (this.availableActions.find(action => action === 'NEXT')) {
                const navigateNextEvent = new FlowNavigationNextEvent();
            } else if (this.availableActions.find(action => action === 'FINISH')) {
                const navigateFinishEvent = new FlowNavigationFinishEvent();

    closeModal() {
        this.dispatchEvent(new CloseActionScreenEvent());

I was trying to use the closeModal function and call it after calling the showToastMessage function.

1 Answer 1


If I understood your question correctly you are calling the flow directly from a Quick Action.

If you are then all you'd need to do is fire a FlowNavigationFinishEvent.

To my knowledge you'd use CloseActionScreenEvent if you are using an LWC quick action and want to close it

You must log in to answer this question.

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