Resume a Flow Interview

You can customize how and where users can resume their interviews by embedding the lightning-flow component in a custom LWC component.

To use this component, build a flow with the Salesforce Flow Builder first. The component includes the navigation buttons Back, Next, Pause, and Finish.

If your flow has custom Lightning web components or Aura components, then you can’t use lightning-flow on Experience Cloud sites that use Lightning Web Runtime.

By default, users can resume interviews that they paused from the Paused Interviews component on their home page. To customize how and where users can resume their interviews, embed the lightning-flow component in a custom LWC component and pass the interview ID into the flow-interview-id attribute.

This example shows how you can resume an interview, or start a new one. When users click Survey Customer from a contact record, the lightning-flow component does one of these actions.

  • If the user has any paused interviews for the Survey Customers flow, the lightning-flow component resumes the first one.
  • If the user doesn’t have any paused interviews for the Survey Customers flow, the lightning-flow component starts a new one.

This Apex controller gets a list of paused interviews by performing a SOQL query. The query returns a null value if there are no paused interviews, and then the component starts a new interview. If the query returns at least one interview, the component resumes the first interview in that list.

If the Apex controller returns an interview ID, the pausedInterviewId passes to the flow-interview-id attribute. If the Apex controller returns a null interview ID, the component starts a new interview by passing the flow name to the flow-api-name attribute.