All Products
Search
Document Center

DataWorks:GenerateDISyncTaskConfigForCreating

Last Updated:Aug 28, 2026

Generates an asynchronous thread ID for creating a Data Integration synchronization task. Use the thread ID with QueryDISyncTaskConfigProcessResult to obtain the task creation parameters.

Operation description

Use CreateDISyncTask to directly create batch synchronization tasks. For real-time or other synchronization task types, call GenerateDISyncTaskConfigForCreating to generate an asynchronous thread ID, then call QueryDISyncTaskConfigProcessResult to obtain the required parameters. Pass these parameters to CreateDISyncTask to create the task. Real-time and other synchronization task types can only be created asynchronously.

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

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request parameters

Parameter

Type

Required

Description

Example

ProjectId

integer

Yes

The DataWorks workspace ID. You can find this on the Workspace page.

10000

TaskType

string

Yes

The synchronization task type. Valid values:

  • DI_OFFLINE: batch synchronization task

  • DI_REALTIME: real-time synchronization task

  • DI_SOLUTION: other synchronization task types

DI_REALTIME

TaskParam

string

Yes

The synchronization task script in JSON format. Supported synchronization types:

  • MySQL to MaxCompute

  • MySQL to Kafka

  • MySQL to Hologres

Use SelectedTables for tables from multiple databases, or Tables for a single database.

Sample script for MySQL to MaxCompute synchronization:

{
  "type": "realtime",
  "version": "1.0",
  "setting": {
    "resourceGroup": "S_res_group_280749521950784_1623033752022",
    "taskType": "oneclick_to_odps"
  },
  "steps": [
    {
      "stepType": "mysql",
      "parameter": {
        "connection": [
          {
            "datasourceType": "mysql",
            "datasource": "mysql_pub1",
            "selectedTables": [
              {
                "dbName": "mysql_db",
                "schema": [
                  {
                    "tableInfos": [
                      {
                        "table": "molin_di_test_in_pk_v4"
                      }
                    ]
                  }
                ]
              }
            ]
          }
        ]
      },
      "name": "Reader",
      "category": "reader"
    },
    {
      "stepType": "odps",
      "parameter": {
        "datasource": "odps_source"
      },
      "name": "Writer",
      "category": "writer"
    }
  ]
}

Sample script for MySQL to Kafka synchronization:

{
  "type": "realtime",
  "version": "1.0",
  "setting": {
    "resourceGroup": "S_res_group_280749521950784_1623033752022",
    "taskType": "oneclick_to_kafka"
  },
  "steps": [
    {
      "stepType": "mysql",
      "parameter": {
        "connection": [
          {
            "datasourceType": "mysql",
            "datasource": "pkset_test",
            "selectedTables": [
              {
                "dbName": "mysql_db",
                "schema": [
                  {
                    "tableInfos": [
                      {
                        "table": "molin_di_test_in_pk_v4"
                      }
                    ]
                  }
                ]
              }
            ]
          }
        ]
      },
      "name": "Reader",
      "category": "reader"
    },
    {
      "stepType": "kafka",
      "parameter": {
        "datasource": "azn_kafka"
      },
      "name": "Writer",
      "category": "writer"
    }
  ]
}

Sample script for MySQL to Hologres synchronization:

{
  "type": "realtime",
  "version": "1.0",
  "setting": {
    "resourceGroup": "S_res_group_280749521950784_1623033752022",
    "taskType": "oneclick_to_holo"
  },
  "steps": [
    {
      "stepType": "mysql",
      "parameter": {
        "connection": [
          {
            "datasourceType": "mysql",
            "datasource": "mysql_pub",
            "selectedTables": [
              {
                "dbName": "mysql_db",
                "schema": [
                  {
                    "tableInfos": [
                      {
                        "table": "molin_di_test_in2_pk_v3"
                      }
                    ]
                  }
                ]
              }
            ]
          }
        ]
      },
      "name": "Reader",
      "category": "reader"
    },
    {
      "stepType": "holo",
      "parameter": {
        "datasource": "holo"
      },
      "name": "Writer",
      "category": "writer"
    }
  ]
}

{ "type": "realtime", "version": "1.0", "setting": { "resourceGroup": "S_res_group_280749521950784_1623033752022", "scheduleResgroupId": 30003913, "name": "openapi_realtime_solution_0813_1739", "taskType": "oneclick_to_odps" }, "steps": [ { "stepType": "mysql", "parameter": { "connection": [ { "datasourceType": "mysql", "datasource": "mysql_pub", "table": [ "xyx" ] } ] }, "name": "Reader", "category": "reader" }, { "stepType": "odps", "parameter": { "datasource": "odps_first" }, "name": "Writer", "category": "writer" } ] }

ClientToken

string

No

A client token for idempotent requests. Prevents duplicate operations from retried calls.

ABFUOEUOTRTRJKE

Response elements

Element

Type

Description

Example

object

The response parameters.

Success

boolean

Indicates whether the request succeeded. Valid values:

  • true

  • false

true

RequestId

string

The request ID.

0bc1411515937635973****

Data

object

The asynchronous thread information.

Status

string

The generation status. Valid values:

  • success: the thread ID was generated.

  • fail: generation failed. Check Message for details.

true

ProcessId

integer

The asynchronous thread ID. Pass this to QueryDISyncTaskConfigProcessResult to obtain the task creation parameters.

10

Message

string

The error message returned on failure. Empty on success.

XXX is invalid.

Examples

Success response

JSON format

{
  "Success": true,
  "RequestId": "0bc1411515937635973****",
  "Data": {
    "Status": "true",
    "ProcessId": 10,
    "Message": "XXX is invalid."
  }
}

Error codes

HTTP status code

Error code

Error message

Description

400 Invalid.DI.Parameter The parameter is invalid.
400 Invalid.DI.Parameter.File.Existed The file name already exists.
500 InternalError.DI.Parameter A DI internal error occurred.
403 Forbidden.DI.NoPrivilege No access.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.