--- title: "Create a One-Time Cron" url: https://docs.catalyst.zoho.com/en/sdk/java/v1/job-scheduling/cron/create-one-time-cron/ description: "This page describes the Java method to create a one-time cron with sample code snippets." last_updated: 2026-09-08T11:07:33Z service: Job Scheduling type: general related_links: - name: "Component Help Documentation" url: /en/job-scheduling/help/cron/introduction/ - name: "JavaScript SDK Documentation" url: /en/sdk/javascript/v1/job-scheduling/cron/create-one-time-cron/ - name: "Python SDK" url: /en/sdk/python/v1/job-scheduling/cron/create-one-time-cron/ - name: "REST API Collection" url: /en/api/code-reference/job-scheduling/cron/create-cron/create-one-time-cron/#CreateaOne-TimeCron --- # Create a One-Time Cron The [Cron](https://docs.catalyst.zoho.com/en/job-scheduling/help/cron/introduction/) component is used to schedule the submission of a [job](https://docs.catalyst.zoho.com/en/job-scheduling/help/job/introduction/) to the [job Pool](https://docs.catalyst.zoho.com/en/job-scheduling/help/jobpool/introduction/). Using the following SDK, you will be able to create a cron that will schedule a job submission only once. > **Note:** The following SDK is written for a job that will trigger a [Job Function](https://docs.catalyst.zoho.com/en/serverless/help/functions/job-functions/). To make the SDK compatible for the other types, you need to replace the value with proper [**Job Pool ID**](https://docs.catalyst.zoho.com/en/job-scheduling/help/jobpool/key-concepts/#job-pool-id), or **Job Pool Name**, and provide the appropriate **Target Name**, or **Target ID**. #### Sample Code Snippet **Package Imports** ```java import com.zc.component.jobscheduling.beans.cron.ZCCronDetails; import com.zc.component.jobscheduling.beans.cron.ZCCronBuilder; import com.zc.component.jobscheduling.beans.job.ZCJobBuilder; import com.zc.component.jobscheduling.beans.job.ZCJobMetaDetail; import org.json.simple.JSONObject; ``` ```java // generate function job meta ZCJobMetaDetail jobMeta = ZCJobBuilder.functionJobBuilder() // get function job builder .setJobConfig(2, 15 * 60 l) // set job config - job retries => 2 retries in 15 mins (optional) .setJobpoolName("functions_jobpool") // set the name of the function jobpool (optional) (either jobpoolId or jobpoolName is mandatory) // .setJobpoolId(1234567890L) // set the Id of the function jobpool (optional) (either jobpoolId or jobpoolName is mandatory) .setTargetName("target_function") // set target function's name (optional) (either TargetName or TargetId is mandatory) // .setTargetId(1234567890L) // set the target function's Id (optional) (either TargetName or TargetId is mandatory) .setParams(new JSONObject() { { put("arg1", "job"); put("arg2", "test"); } }) // set params to be passed to target function (optional) .setJobName("job_name") // set job name .build(); // build job meta // generate cron details ZCCronDetails oneTimeCronDetails = ZCCronBuilder.zcOneTimeCronBuilder() // get one time cron builder .setCronStatus(true) // set cron as enabled .cronConfig((System.currentTimeMillis() / 1000) + (60 * 60), "America/Los_Angeles") // set the execution time as UNIX timestamp in seconds .setJobMeta(jobMeta) // set job meta (modify based on the job) .setCronName("one_time_cron") // set cron name (unique) .setCronDescription("one_time_cron") // set corn description (optional) .build(); // build cron details // create one time cron ZCCronDetails oneTimeCron = jobScheduling.cron.createCron(oneTimeCronDetails); ``` > **Note:** We urge you to use this SDK to configure only [Dynamic Crons](https://docs.catalyst.zoho.com/en/job-scheduling/help/implementation/submit-job-dynamic-cron/). Use the *UI Builder* to configure [Pre-defined Crons](https://docs.catalyst.zoho.com/en/job-scheduling/help/implementation/submit-job-predefined-cron/).