All Products
Search
Document Center

SchedulerX:CreateJob

Last Updated:Apr 20, 2026

Creates a task and returns the task ID.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

edas:CreateSchedulerxJobCreate

create

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The ID of the region.

cn-hangzhou

Namespace

string

Yes

The ID of the namespace. You can find this ID on the Namespaces page in the SchedulerX console.

adcfc35d-e2fe-4fe9-bbaa-20e90ffc****

NamespaceSource

string

No

This parameter is required only for specific third-party integrations.

schedulerx

GroupId

string

Yes

The ID of the application. You can find the application ID on the Application Management page in the SchedulerX console.

testSchedulerx.defaultGroup

JobType

string

Yes

The type of the job. The following job types are supported:

  • java

  • python

  • shell

  • go

  • http

  • xxl-job

  • DataWorks

  • Kubernetes (k8s)

  • springschedule

Valid values:

  • python :

    python

  • xxljob :

    xxl-job

  • java :

    java

  • shell :

    shell

  • golang :

    golang

  • go :

    go

  • http :

    http

  • dataworks :

    DataWorks

java

Name

string

Yes

The job name.

helloworld

Description

string

No

The job description.

Test

ExecuteMode

string

Yes

The job execution mode. Valid values:

  • standalone: The job runs on a single worker.

  • broadcast: The job is broadcast to all workers.

  • parallel: The job runs in parallel computing mode.

  • batch: The job runs in batch processing mode.

  • sharding: The job runs in sharding mode.

Valid values:

  • broadcast :

    broadcast

  • parallel :

    parallel

  • grid :

    grid

  • batch :

    batch

  • standalone :

    standalone

  • sharding :

    sharding

standalone

ClassName

string

No

The fully qualified name of the job interface class.

This parameter is required if you set JobType to java.

com.alibaba.schedulerx.test.helloworld

Content

string

No

  • If JobType is python, shell, or k8s, specify the script content.

  • If JobType is go, the content must be in the following format: {"jobName":"HelloWorld"}.

echo 'hello'

Parameters

string

No

User-defined parameters that the job can retrieve at runtime.

test

MaxConcurrency

integer

No

The maximum number of concurrent job instances. Defaults to 1. When this limit is reached, scheduled job instances are skipped until a running instance completes.

1

MaxAttempt

integer

No

The maximum number of retries for a failed job. Default: 0.

0

AttemptInterval

integer

No

The interval between retries for a failed job, in seconds. Default: 30.

30

PageSize

integer

No

For parallel or batch jobs, this parameter specifies the number of subtasks to retrieve in a single pull. Default: 100.

100

ConsumerSize

integer

No

For parallel or batch jobs, this parameter specifies the number of threads on a single worker for executing subtasks per trigger. Default: 5.

5

QueueSize

integer

No

For parallel or batch jobs, this parameter specifies the maximum size of the subtask queue. Default: 10,000.

10000

DispatcherSize

integer

No

For parallel or batch jobs, this parameter specifies the number of threads for dispatching subtasks. Default: 5.

5

TimeType

integer

Yes

The type of the time expression. Valid values:

  • 1: cron

  • 3: fixed_rate

  • 4: second_delay

  • 5: one_time

  • 100: api

  • -1: none (no time-based scheduling)

Valid values:

  • 1 :

    1

  • 3 :

    3

  • 4 :

    4

  • 5 :

    5

  • 100 :

    100

1

TimeExpression

string

No

The format of this expression depends on the value of TimeType.

  • If TimeType is 1 (cron), specify a standard cron expression. Online validators are available.

  • If TimeType is 100 (api), no time expression is required.

  • If TimeType is 3 (fixed_rate), specify a fixed interval in seconds. For example, 30 indicates that the job is triggered every 30 seconds.

  • If TimeType is 4 (second_delay), specify a fixed delay in seconds. Valid values: 1 to 60.

  • If TimeType is 5 (one_time), specify a point in time in the yyyy-MM-dd HH:mm:ss format or a timestamp in milliseconds. Example: 2022-10-10 10:10:00.

0 0/10 * * * ?

Calendar

string

No

If TimeType is 1 (cron), you can optionally specify a custom calendar.

DataOffset

integer

No

If TimeType is 1 (cron), you can optionally specify a time offset in seconds.

2400

Timezone

string

No

The time zone for scheduling.

GMT+8

TimeoutEnable

boolean

No

Specifies whether to send an alert when a job times out. Valid values:

  • true: enabled.

  • false: disabled.

Valid values:

  • false :

    false

  • true :

    true

false

Timeout

integer

No

The timeout threshold in seconds. Default: 7,200.

7200

TimeoutKillEnable

boolean

No

Specifies whether to terminate a job that has timed out. Valid values:

  • true: enabled.

  • false: disabled.

Valid values:

  • false :

    false

  • true :

    true

false

FailEnable

boolean

No

Specifies whether to send an alert when a job fails. Valid values:

  • true: enabled.

  • false: disabled.

Valid values:

  • false :

    false

  • true :

    true

false

FailTimes

integer

No

The number of consecutive failures that trigger an alert.

2

MissWorkerEnable

boolean

No

Specifies whether to send an alert if no workers are available to run the job. Valid values:

  • true: enabled.

  • false: disabled.

false

SuccessNoticeEnable

boolean

No

Specifies whether to send a notification upon successful job completion.

false

SendChannel

string

No

The channel for sending alert notifications. Valid values:

  • default: Uses the default channel configured for the application group.

  • Alternatively, you can specify one or more job-specific channels: sms, mail, phone, or webhook.

Valid values:

  • default :

    default

  • webhook :

    webhook

  • mail :

    mail

  • phone :

    phone

  • sms :

    sms

sms

TaskMaxAttempt

integer

No

For parallel or batch jobs, this parameter specifies the maximum number of retries for a failed subtask. Default: 0.

0

TaskAttemptInterval

integer

No

For parallel or batch jobs, this parameter specifies the retry interval for a failed subtask. Default: 0.

0

ContactInfo

array<object>

No

The contact information for the job.

Important This parameter is deprecated.

1

object

No

The contact information for the job.

UserPhone

string

No

The mobile phone number of the alert contact.

1381111****

UserName

string

No

The name of the alert contact.

John Smith

UserMail

string

No

The email address of the alert contact.

test***@***.com

Ding

string

No

The webhook URL of the DingTalk group chatbot for receiving alert notifications. For more information, see the DingTalk documentation.

https://oapi.dingtalk.com/robot/send?access_token=**********

Status

integer

No

Specifies whether to enable the job. Valid values: 0 (disabled) and 1 (enabled). The default value is 1.

1

XAttrs

string

No

The extended attributes for the job, required when JobType is k8s. For a Kubernetes (k8s) job, specify {"resource":"job"}. For a Kubernetes (k8s) shell job, specify {"image":"busybox","resource":"shell"}.

{"resource":"job"}

Priority

integer

No

The job priority. Valid values:

  • 1: Low

  • 5: Medium

  • 10: High

  • 15: Very High

5

Response elements

Element

Type

Description

Example

object

Code

integer

The response code.

200

Message

string

A message that provides details about the response.

message

RequestId

string

The unique request ID.

39090022-1F3B-4797-8518-6B61095F1AF0

Success

boolean

Specifies whether the job was created successfully. Valid values:

  • true: The job was created successfully.

  • false: The job creation failed.

true

Data

object

The job details.

JobId

integer

The job ID.

92583

Examples

Success response

JSON format

{
  "Code": 200,
  "Message": "message",
  "RequestId": "39090022-1F3B-4797-8518-6B61095F1AF0",
  "Success": true,
  "Data": {
    "JobId": 92583
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.