All Products
Search
Document Center

SchedulerX:CreateJob

Last Updated:Mar 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 region ID.

cn-hangzhou

Namespace

string

Yes

The namespace ID. You can find this ID on the Namespace page in the console.

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

NamespaceSource

string

No

The namespace source. This parameter is required only for specific third-party services.

schedulerx

GroupId

string

Yes

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

testSchedulerx.defaultGroup

JobType

string

Yes

The job type. Valid values:

  • java

  • python

  • shell

  • go

  • http

  • xxljob

  • dataworks

  • k8s

  • springschedule

Valid values:

  • python :

  • xxljob :

  • java :

  • shell :

  • golang :

  • go :

  • http :

  • 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: standalone

  • Broadcast: broadcast

  • Parallel: parallel

  • MapReduce: batch

  • Sharding: sharding

Valid values:

  • broadcast :

  • parallel :

  • grid :

  • batch :

  • standalone :

  • sharding :

standalone

ClassName

string

No

The fully qualified class name of the job interface.

This parameter is required if you set JobType to java.

com.alibaba.schedulerx.test.helloworld

Content

string

No

  • If you set JobType to python, shell, or k8s, specify the script content.

  • If you set JobType to go, specify the content in the JSON format. Example: {"jobName":"HelloWorld"}.

echo 'hello'

Parameters

string

No

The user-defined parameters. You can obtain the value of this parameter at runtime.

test

MaxConcurrency

integer

No

The maximum number of instances that can be run at the same time. Default value: 1. This indicates that if the last run has not ended, the next run is not triggered even if the scheduled time is reached.

1

MaxAttempt

integer

No

The number of retries after a job fails. Default value: 0.

0

AttemptInterval

integer

No

The retry interval. Unit: seconds. Default value: 30.

30

PageSize

integer

No

The number of subtasks that are pulled at a time. Default value: 100. This parameter is used for advanced configurations of parallel and batch jobs.

100

ConsumerSize

integer

No

The number of threads that are triggered by a single worker at a time. Default value: 5. This parameter is used for advanced configurations of parallel and batch jobs.

5

QueueSize

integer

No

The maximum size of the subtask queue. Default value: 10000. This parameter is used for advanced configurations of parallel and batch jobs.

10000

DispatcherSize

integer

No

The number of threads for distributing subtasks. Default value: 5. This parameter is used for advanced configurations of parallel and batch jobs.

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 (The job is triggered only by API calls.)

  • -1: none (The job is not scheduled.)

Valid values:

  • 1 :

  • 3 :

  • 4 :

  • 5 :

  • 100 :

1

TimeExpression

string

No

The time expression. The format of the time expression varies based on the value of TimeType.

  • If you set TimeType to cron, specify a standard cron expression.

  • If you set TimeType to api, you do not need to specify a time expression.

  • If you set TimeType to fixed_rate, specify a fixed interval in seconds. For example, if you enter 30, the job is triggered every 30 seconds.

  • If you set TimeType to second_delay, specify a fixed delay from 1 second to 60 seconds.

  • If you set TimeType to one_time, specify a 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

Specifies a custom calendar if you set TimeType to cron.

暂不支持,不用填写

DataOffset

integer

No

The time offset. Unit: seconds. This parameter is available only if you set TimeType to cron.

2400

Timezone

string

No

The time zone.

GMT+8

TimeoutEnable

boolean

No

Specifies whether to enable timeout alerts. Valid values:

  • true

  • false

Valid values:

  • false :

    false

  • true :

    true

false

Timeout

integer

No

The timeout threshold. Unit: seconds. Default value: 7200.

7200

TimeoutKillEnable

boolean

No

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

  • true

  • false

Valid values:

  • false :

    false

  • true :

    true

false

FailEnable

boolean

No

Specifies whether to enable failure alerts. Valid values:

  • true

  • false

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 enable alerts for no available workers. Valid values:

  • true

  • false

false

SuccessNoticeEnable

boolean

No

Specifies whether to send a notification when the job is successful.

false

SendChannel

string

No

The notification channel for sending alerts.

  • default: Use the default channel of the application group.

  • You can also specify channels for the job, such as sms, mail, phone, and webhook.

Valid values:

  • default :

    default

  • webhook :

    webhook

  • mail :

    mail

  • phone :

    phone

  • sms :

    sms

sms

TaskMaxAttempt

integer

No

The number of retries for a failed subtask. Default value: 0. This parameter is used for advanced configurations of parallel and batch jobs.

0

TaskAttemptInterval

integer

No

The retry interval for a failed subtask. Default value: 0. This parameter is used for advanced configurations of parallel and batch jobs.

0

ContactInfo

array<object>

No

The contact information of the job.

Important This parameter is deprecated.

1

object

No

The contact information of the job.

UserPhone

string

No

The mobile number of the alert contact.

1381111****

UserName

string

No

The name of the alert contact.

张三

UserMail

string

No

The email address of the alert contact.

test***@***.com

Ding

string

No

The webhook URL of the DingTalk group chatbot. For more information, see the DingTalk development documentation.

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

Status

integer

No

The job status. Valid values: 0 (disabled) and 1 (enabled). By default, jobs are enabled.

1

XAttrs

string

No

The extended attributes. This parameter is required if you set JobType to k8s. * For a job resource: {"resource":"job"} * For a shell resource: {"image":"busybox","resource":"shell"}

{"resource":"job"}

Priority

integer

No

The priority of the job. Valid values:

  • 1: Low

  • 5: Medium

  • 10: High

  • 15: Very High

5

Response elements

Element

Type

Description

Example

object

Code

integer

The return code.

200

Message

string

The response message.

message

RequestId

string

The ID of the request.

39090022-1F3B-4797-8518-6B61095F1AF0

Success

boolean

Indicates whether the job was created. Valid values:

  • true: The job was created.

  • false: The job failed to be created.

true

Data

object

The details of the job.

JobId

integer

The ID of the job.

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.