adminUser(); $tq = new VTTaskQueue($adb); $readyTasks = $tq->getReadyTasks(); $tm = new VTTaskManager($adb); foreach($readyTasks as $taskDetails){ list($taskId, $entityId, $taskContents) = $taskDetails; $task = $tm->retrieveTask($taskId); //If task is not there then continue if(empty($task)){ continue; } $task->setContents($taskContents); $entity = VTEntityCache::getCachedEntity($entityId); if(!$entity) { $entity = new VTWorkflowEntity($adminUser, $entityId); } $task->doTask($entity); } } $adb = PearDatabase::getInstance(); require_once 'modules/com_vtiger_workflow/WorkFlowScheduler.php'; $workflowScheduler = new WorkFlowScheduler($adb); $workflowScheduler->queueScheduledWorkflowTasks(); vtRunTaskJob($adb);