System variables for script tasks

更新时间:
复制 MD 格式

This topic describes the system variables for script tasks.

Variable reference

Note

Agent version 1.12.5 or later is required.

All variables follow the #{schedulerx.<variableName>} syntax.

Variable

Description

Scope

Example

#{schedulerx.jobParameters}

Job parameters passed to the task.

All tasks

test

#{schedulerx.shardingId}

Shard ID assigned to the current instance. This variable is supported for broadcast and sharding tasks.

Broadcast and sharding tasks

0

#{schedulerx.shardingParameters}

Shard parameters for the current shard. This variable is supported for sharding tasks.

Sharding tasks only

hangzhou

#{schedulerx.shardingNum}

Total number of shards. This variable is supported for broadcast and sharding tasks.

Broadcast and sharding tasks

2

#{schedulerx.attempt}

The number of task retries.

All tasks

0

#{schedulerx.triggerType}

The trigger type. Returns a numeric code. See Trigger types.

All tasks

1

#{schedulerx.scheduleTime}

The scheduling timestamp, in milliseconds.

All tasks

1743150114875

#{schedulerx.dataTime}

The data timestamp, in milliseconds.

All tasks

1743150114875

Trigger types

#{schedulerx.triggerType} returns one of the following numeric codes:

Value

Trigger type

1

Timed scheduling

2

Data backfill

3

API call

4

Manual rerun

5

System retry

6

Manual run