Newer Version Available

This content describes an older version of this product. View Latest

Resume a Flow Interview from a Lightning Component

By default, users can resume their paused interviews from the Paused Interviews component on their home page in Salesforce Classic. If you want to customize how and where users can resume their interviews, pass the interview ID into the resumeFlow method in your JavaScript controller.

Example

This example show how you can resume an interview—or start a new one. When users click Survey Customer from a contact record, the Lightning component does one of two things.

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

This Apex controller performs a SOQL query to get a list of paused interviews. If nothing is returned from the query, getPausedId() returns a null value, and the component starts a new interview. If at least one interview is returned from the query, the component resumes the first interview in that list.

If the JavaScript controller got an interview ID back from the Apex controller, the component resumes that interview. If the Apex controller returned a null interview ID, the component starts a new interview.