I have a flow as described in the title. If I click on the 'Run' button i receive the following error:
The flow failed to start because the provided values were not valid: Scheduled Flow could only be run from a schedule
If i try with the following code:
Map<String, Object> params = new Map<String, Object>();
Flow.Interview.FlowName thisFlow = new Flow.Interview.FlowName(params);
thisFlow.start();
I receive the same error (as expected):
System.FlowException: The flow failed to start because the provided values were not valid: Scheduled Flow could only be run from a schedule
I tried also this way:
System.schedule('my flow ' + String.valueOf(Datetime.now()), nextFireTime, thisFlow);
and I receive the following:
Method does not exist or incorrect signature: void schedule(String, String, Flow.Interview.FlowName) from the type System
What's the proper way to run such flows?
EDIT: I tried to run the flow as explained in another question creating this class
public class ChargentRecurringInjector_Scheduler implements Schedulable {
public void execute(SchedulableContext sc) {
Map<String, Object> params = new Map<String, Object>();
Flow.Interview.Chargent_recurring_injector_for_scheduledBatchProcessing thisFlow = new Flow.Interview.Chargent_recurring_injector_for_scheduledBatchProcessing(params);
thisFlow.start();
}
}
and executing it via System.schedule(...); but, from my developer logs I still can read the same error : "The flow failed to start because the provided values were not valid: Scheduled Flow could only be run from a schedule"