Programmatically schedule the execution of a component I have found the function rules_scheduler_schedule_task() under the rules module which supposedly does exactly what I want, but I have trouble interpreting how the function arguments are built. The arguments of that function are an array with the following keys :


config: The machine readable name of the to be scheduled component.
date: When the component should be executed. 
identifier: User provided string to identify the task per scheduled


And finally :


state: A rules evaluation state to use for scheduling.


I don't have any trouble with the first three arguments, but what is the meaning of the later (state) ? Is it where I put the arguments of the components ?
Could someone provide an example ?
I know this is an older post, but I had the same problem, and found this post. I found the answer so maybe someone can use it later:

$state = new RulesState();
$state-&gt;addVariable('variable_name', $variable, array());
// 3rd parameter is called $info it must be an array, but i don't know it's function

$task = array(
'identifier' =&gt; 'unique_id_of_scheduled_task',
'date' =&gt; time(), // timestamp
'config' =&gt; 'id_of_the_rule_component_to_run',
'state' =&gt; $state,
);

rules_scheduler_schedule_task($task);


So you have to create a RulesState object and pass in that in place of the 'state' parameter.
I had to do this because in Rules I couldn't get the timestamp I wanted when I was configuring the "Schedule component evaluation" action.