function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
OviOvi 

Invoke visual flow from apex

Is it possible to invoke a Visual Flow from apex programatically.
The flow does not require any user interactions.
I have tried with a Http request from a apex class, but that does not seem to start the flow.
Anyone knows how to achieve this?
Vinita_SFDCVinita_SFDC
Hello,

Process.Plugin is a built-in interface that allows you to pass data between your organization and a specified flow. For details please refer:

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_process_plugin.htm
OviOvi
thanks for your reply. But I got the question wrong. I am not looking for how to execute apex code, but how to kick of the flow from an apex controller.
Vinita_SFDCVinita_SFDC
Hello,

You can embed a flow in visualforce page using <flow:interview> tag.

EX: <!-- Page: -->
<apex:page controller="exampleCon">
<!-- embed a simple flow -->
<flow:interview name="my_flow" interview="{!my_interview}"></flow:interview>
<!-- get a variable from the embedded flow using my_interview.my_variable -->
<apex:outputText value="here is my_variable : {!my_interview.my_variable}"/>
</apex:page>

/*** Controller ***/
public class exampleCon {
    Flow.Interview.my_flow my_interview {get; set;}
}

For details please refer visualforce guide:

http://www.salesforce.com/us/developer/docs/pages/
OviOvi
I would like to invoke the Flow from a Future method called from a apex trigger