--- title: "Create a One-Time Cron" url: https://docs.catalyst.zoho.com/en/sdk/javascript/v1/job-scheduling/cron/create-one-time-cron/ description: "This page describes the method to perform operations in the DataStore component." last_updated: 2026-09-09T10:45:38Z service: Job Scheduling type: general related_links: - name: "Catalyst Job Scheduling" url: /en/job-scheduling/ - name: "Cron" url: /en/job-scheduling/help/cron/introduction/ - name: "Java SDK Documentation" url: /en/sdk/java/v1/job-scheduling/cron/create-one-time-cron/ - name: "Python SDK Documentation" url: /en/sdk/python/v1/job-scheduling/cron/create-one-time-cron/ - name: "REST API Documentation" url: /en/api/code-reference/job-scheduling/cron/create-cron/create-one-time-cron/#CreateaOne-TimeCron repository: name: "Repository" url: https://github.com/catalystbyzoho/zcatalyst-sdk-js --- # Create a One-Time Cron > **Note:** Ensure you have installed the [required package](https://docs.catalyst.zoho.com/en/sdk/javascript/v1/job-scheduling/overview/#prerequisites) to use this SDK method. You can configure the required cron as a JSON object and pass it to the `createCron()` SDK method to create your required cron. The following example snippet will detail how to create a **One-Time Cron** that will schedule the submission of a job to the job pool only once. The `jobScheduling` reference used in the code snippets below is the [component instance](https://docs.catalyst.zoho.com/en/sdk/javascript/v1/job-scheduling/create-instance/) created to perform these operations. > **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 the 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**. #### Parameters Used You need to construct two JSON objects, one that provides the meta of the job that needs to be submitted and the other is to contain your cron's meta that will schedule the submission of the job to the job pool. The JSON attributes used in these two JSONs are provided in the following table:
JSON Object JSON Attributes Definition
`job_meta` `job_name` **Mandatory** parameter. Contains the name of the job that needs to be submitted to the job pool.
`target_type` **Mandatory** parameter. Contains the type of the job. (**Function** | **Circuit** | **Webhook** | **AppSail**).
`target_name` or `target_id` **Mandatory** parameter. Contains the name or ID of the target type. While it is mandatory to provide value for either of them, it is optional to provide values for both fields.
`jobpool_name` or `jobpool_id` **Mandatory** parameter. Contains the name or ID of the Job Pool. While it is mandatory to provide value for either of them, it is optional to provide values for both fields.
`job_config`
  • **Optional** parameter. The number of retries and the retry interval can be provided as a JSON key-value pair.
  • `number_of_retries`: The number of retries that need to be attempted.
  • `retry_interval`: The interval in which the retries need to occur.
`oneTimeCron` `cron_name` **Mandatory** parameter. To refer to your cron. Ensure you provide a unique name.
`description` **Optional** parameter. You can provide a description for your cron.
`cron_status` **Mandatory** parameter. Determines if the cron is enabled or not. Ensure it is set as '**true**'.
`cron_type` **Mandatory** parameter. Determines the type of Cron.
`cron_detail` **Mandatory** parameter. Provide the schedule time in a **UNIX timestamp format**.
`job_meta` **Mandatory** parameter. Pass the `jobMeta` JSON object as value.
```javascript // create function job meta const jobMeta = { job_name: 'test_job', // set a name for the job target_type: 'Function', // set the target type as Function for function jobs target_name: 'target_function', // set the target function's name (optional) (either target_id or target_name is mandatory) // target_id: '123467890', // set the target function's ID (optional) (either target_id or target_name is mandatory) jobpool_name: 'test', // set the name of the function jobpool (optional) (either jobpool_name or jobpool_id is mandatory) // jobpool_id: '1234567890' // set the ID of the function jobpool (optional) (either jobpool_name or jobpool_id is mandatory) job_config: { number_of_retries: 2, // set the number of retries retry_interval: 15 * 60 // set the retry interval }, // set job config - job retries => 2 retries in 15 mins (optional) params: { arg1: 'test', arg2: 'job' } // set params to be passed to target function (optional) }; // create one time cron details const oneTimeCron = { cron_name: 'one_time', // set a name for the cron (unique) description: 'one_time_cron', // set a description for the cron (optional) cron_status: true, // set the cron status as enabled cron_type: 'OneTime', // set the cron type as OneTime cron_detail: { time_of_execution: Math.floor(Date.now() / 1000) + 60 * 60 + '' // set the execution time as UNIX timestamp // timezone: 'America/Los_Angeles' // set the timezone (optional) }, job_meta: jobMeta // set the function job meta }; // create one time cron const cronDetails = await jobScheduling.CRON.createCron(oneTimeCron); ``` > **Note:** We urge you to use this SDK to exclusively configure [Dynamic Crons](https://docs.catalyst.zoho.com/en/job-scheduling/help/implementation/submit-job-dynamic-cron/), and use the console's UI *Builder* to exclusively configure [Pre-defined Crons](https://docs.catalyst.zoho.com/en/job-scheduling/help/implementation/submit-job-predefined-cron/).