I try to start a Flow in Visualforce Page. This Flow has Apex-Defined type input variables.

My Apex-Defined Class code

public class OpportunityCloseConfig {

public String currentType;

public String avoidStage;    

My code for start flow

    $Lightning.use("c:LightningFlowApp", function() { 
       $Lightning.createComponent("lightning:flow", {"onstatuschange":handleFlowStatusChange},
          function (component) {
              var flowName = flow.ApiName;                        
              var namespace = flow.NamespacePrefix;
              var apexObject = {
                  currentType: "Existing Customer - Downgrade",
                  avoidStage: "Closed Won"
              var jsonString = JSON.stringify(apexObject);
              var inputVariables = [
                    config: apexObject
              component.startFlow(flowName, inputVariables);

When I start flow I got follow error message on Screen, please see this image.

enter image description here

In Browser Console I also found error message "Error in $A.getCallback() [[object Object]]", does anyone know what's wrong in our code and how to fixed it?

1 Answer 1


You can start the flow from Visualforce page by using the below sample code -

<apex:page standardController="Contact">  
   <flow:interview name="<NAME OF YOUR FLOW>" finishLocation="{!URLFOR('/003')}">  
     <apex:param name="currentType" value="Existing Customer - Downgrade" />  
     <apex:param name="avoidStage" value="Closed Won" />  

You can replace with the actual flow api name.

  • Thanks for your idea, after discuss with my team, we decide call this a limitation.
    – GhostLee
    Jan 22, 2021 at 8:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.