'Creates a cron job that runs given flow with a given frequency.
Args:
cron_args: A protobuf of type CreateCronJobFlowArgs.
job_name: Use this job_name instead of an autogenerated unique name (used
for system cron jobs - we want them to have well-defined
persistent name).
token: Security token used for data store access.
disabled: If True, the job object will be created, but will be disabled.
Returns:
URN of the cron job created.'

def ScheduleFlow(self, cron_args=None, job_name=None, token=None, disabled=False):

    if (not job_name):
        uid = utils.PRNG.GetUShort()
        job_name = ('%s_%s' % (cron_args.flow_runner_args.flow_name, uid))
    cron_job_urn = self.CRON_JOBS_PATH.Add(job_name)
    with aff4.FACTORY.Create(cron_job_urn, aff4_type=CronJob, mode='rw', token=token, force_new_version=False) as cron_job:
        existing_cron_args = cron_job.Get(cron_job.Schema.CRON_ARGS)
        if (existing_cron_args and existing_cron_args.start_time):
            cron_args.start_time = existing_cron_args.start_time
        if (cron_args != existing_cron_args):
            cron_job.Set(cron_job.Schema.CRON_ARGS(cron_args))
        if (disabled != cron_job.Get(cron_job.Schema.DISABLED)):
            cron_job.Set(cron_job.Schema.DISABLED(disabled))
    return cron_job_urn
