I want to embed a flow in a Visualforce page. I have 4 flows in place and a page parameter decides the flow that needs to be embedded in the page. So it is like dynamically deciding the flow to be launched.

Though my controller reads the page attribute for the flow name, the below is not possible in a VF page:

<flow:interview name="{!NameOfTheFlow}"/>

as the name attribute can only be a literal. Can someone suggest any workaround for the above problem?

  • Try having 4 different flows and hiding the ones you don't need with booleans instead.
    – dphil
    Feb 4 '15 at 19:27

A possible workaround could be making a masterflow initiating the appropriate flow. You then only have to start this masterflow, and passing the name of the 'subflow' as a parameter:

<flow:interview name="StartAppropriateFlow">
    <apex:param name="flowName" value="{!NameOfTheFlow}" />

enter image description here

hope this helps. Note that subflows cannot have their own or dynamic finishlocations, so that might be the next issue


I have worked with flows but haven't integrated them with VF pages, so might be I am missing something here, but can't we use literal names only in flow and render them using rendered attribute of outputPanel? Something like this:

<apex:outputPanel rendered="{!renderFlow}">
    <flow:interview name="Flow1"/>
<apex:outputPanel rendered="{!!renderFlow}">
    <flow:interview name="Flow2"/>

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.