CreateProcessDefinitionWithSchedule

Updated at:

Creates a workflow definition.

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

emr-serverless-spark:CreateProcessDefinitionWithSchedule

none

*All Resource

*

None None

Request syntax

POST /dolphinscheduler/projects/{bizId}/process-definition HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

bizId

string

Yes

The workspace ID.

w-d8********

Request parameters

Parameter

Type

Required

Description

Example

productNamespace

string

Yes

The product code.

SS

name

string

Yes

The workflow name.

ods_batch_workflow

description

string

Yes

The workflow description.

ods batch workflow

timeout

integer

No

The default timeout for workflow execution.

60

taskRelationJson

array<object>

Yes

The JSON array of task dependency relationships that contains the dependencies between all tasks in the workflow. preTaskCode specifies the upstream task ID, and postTaskCode specifies the downstream task ID. Each task must have a unique ID. If a task node has no upstream task, you must still add a dependency relationship with preTaskCode set to 0.

object

Yes

The JSON object of a task dependency relationship that contains the dependencies between all tasks in the workflow. preTaskCode specifies the upstream task ID, and postTaskCode specifies the downstream task ID. Each task must have a unique ID. If a task node has no upstream task, you must still add a dependency relationship with preTaskCode set to 0.

name

string

Yes

The name of the task topology relationship. Set this parameter to the workflow name.

ods batch workflow

preTaskCode

integer

Yes

The upstream task ID.

16************

preTaskVersion

integer

Yes

The upstream task version.

1

postTaskCode

integer

Yes

The downstream task ID.

28************

postTaskVersion

integer

Yes

The downstream task version.

1

taskDefinitionJson

array<object>

Yes

The JSON array of task definitions that contains the description information of all tasks in the workflow.

array<object>

Yes

The JSON object of a task definition that contains the description information of all tasks in the workflow.

code

integer

Yes

The task definition ID.

36************

description

string

No

The task definition description.

ods transform task

alertEmailAddress

string

No

The alert email address.

foo_bar@spark.alert.invalid.com

startAlertEnable

boolean

No

Specifies whether to enable the task start alert.

false

failAlertEnable

boolean

No

Specifies whether to enable the task failure alert.

false

failRetryTimes

integer

No

The number of retries upon task failure.

1

name

string

Yes

The task name.

ods_transform_task

taskParams

object

Yes

The task definition parameters.

workspaceBizId

string

Yes

The workspace ID.

w-d8********

taskBizId

string

Yes

The data development task ID.

TSK-d87******************

resourceQueueId

string

Yes

The resource queue for running the Spark task.

root_queue

sparkDriverCores

integer

No

The number of Spark driver cores.

1

sparkExecutorCores

integer

No

The number of Spark executor cores.

1

sparkDriverMemory

integer

No

The Spark driver memory.

4g

sparkExecutorMemory

integer

No

The Spark executor memory.

4g

sparkConf

array<object>

No

The Spark task configuration.

object

No

key

string

No

The key of the Spark configuration.

spark.dynamicAllocation.enabled

value

string

No

The value of the Spark configuration.

true

sparkVersion

string

No

The Spark DPI engine version.

esr-4.0.0 (Spark 3.5.2, Scala 2.12)

sparkLogLevel

string

No

The Spark log level.

INFO

sparkLogPath

string

No

The Spark node task logs path.

oss://data***/spark/logs

displaySparkVersion

string

No

The display version of the Spark engine.

esr-4.0.0 (Spark 3.5.2, Scala 2.12)

fusion

boolean

No

Specifies whether to enable Fusion engine acceleration.

false

environmentId

string

No

The environment ID.

env-crhq2h5lhtgju93buhkg

type

string

No

The Spark task type.

SQL

localParams

array<object>

No

object

No

prop

string

No

direct

string

No

type

string

No

value

string

No

taskType

string

Yes

The workflow node type.

EMR_SERVERLESS_SPARK

timeout

integer

No

The timeout period of the callback method. Unit: seconds.

1200

tags

object

No

The tags.

string

No

The JSON string of the tag key-value pair.

“{\"tagkey\":\"tagvalue\"}”

executionType

string

Yes

The execution strategy.

PARALLEL

alertEmailAddress

string

No

The alert email address.

foo_bar@spark.alert.invalid.com

schedule

object

No

The schedule structure.

startTime

string

No

The schedule start time. Format: YYYY-MM-DD HH:mm:ss.

2024-12-23 16:13:27

endTime

string

No

The schedule end time. Format: YYYY-MM-DD HH:mm:ss.

2025-12-23 16:13:27

crontab

string

No

The schedule cron expression.

0 0 0 * * ?

timezoneId

string

No

The time zone ID.

Asia/Shanghai

retryTimes

integer

No

The number of retries.

1

taskParallelism

integer

No

The task concurrency.

1

resourceQueue

string

No

The resource queue.

root_queue

tags

object

No

The tags.

string

No

The JSON string of the tag key-value pair.

“{\"tagkey\":\"tagvalue\"}”

publish

boolean

No

Specifies whether to publish the workflow.

true

regionId

string

No

The region ID.

cn-hangzhou

runAs

string

No

The Alibaba Cloud UID of the execution user.

113***************

globalParams

array<object>

No

object

No

prop

string

No

value

string

No

direct

string

No

type

string

No

Response elements

Element

Type

Description

Example

object

Schema of Response

requestId

string

The request ID.

DD6B1B2A-5837-5237-ABE4-FF0C8944****

code

integer

The API response code.

1400009

msg

string

The detailed description corresponding to the response code.

No permission for resource action

success

string

Indicates whether the request was successful.

true

failed

string

Indicates whether the request failed.

false

data

object

The response data.

id

integer

The workflow definition number.

12342

code

integer

The workflow definition ID.

160************

httpStatusCode

integer

The HTTP status code.

200

Examples

Success response

JSON format

{
  "requestId": "DD6B1B2A-5837-5237-ABE4-FF0C8944****",
  "code": 1400009,
  "msg": "No permission for resource action",
  "success": "true",
  "failed": "false",
  "data": {
    "id": 12342,
    "code": 0
  },
  "httpStatusCode": 200
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.