---
name: dataworks-open-api-ec7b00362cec
description: Operate Alibaba Cloud DataWorks through dynamic API discovery and official SDKs (Node.js, Python, Java). Covers data development, workflow operations, data integration, data quality, metadata lineage, workspace management, and more. APIs are discovered at runtime from official docs and OpenAPI metadata — no hardcoded list.
source: https://github.com/aliyun/alibabacloud-bigdata-skills
homepage: https://github.com/aliyun/alibabacloud-bigdata-skills/tree/main/skills/dataworks/open-api
env:
  - name: ALIBABA_CLOUD_ACCESS_KEY_ID
    description: Alibaba Cloud Access Key ID (required unless using credentials URI or shared config)
    required: false
  - name: ALIBABA_CLOUD_ACCESS_KEY_SECRET
    description: Alibaba Cloud Access Key Secret (required unless using credentials URI or shared config)
    required: false
  - name: ALIBABA_CLOUD_REGION_ID
    description: Target region (e.g. cn-shanghai, cn-beijing). Optional; skill will prompt if unset.
    required: false
  - name: ALIBABA_CLOUD_CREDENTIALS_URI
    description: HTTP endpoint for dynamic AK/SK/STS token (alternative to explicit AK/SK)
    required: false
---

# DataWorks (dataworks-public)

Use Alibaba Cloud OpenAPI (RPC) with official SDKs or OpenAPI Explorer to manage all DataWorks resources. MCP Server is available as an alternative integration.

## Workflow

1. Confirm region, project/resource identifiers, and desired action.
2. Discover available APIs and required parameters (see API discovery below).
3. Call API via SDK.
4. Verify results with describe/list/get APIs.

### Troubleshooting fallback chain (follow this order)

If execution fails at any step, escalate to the next level:

1. **Cookbook** — check `references/cookbook.md` first. It contains verified API patterns, pitfalls, error recovery, the full end-to-end lifecycle (Create → Submit → Deploy → Run → Monitor), and reusable code snippets. Most common issues are already documented there.
2. **Official help docs** — read the API overview and per-API doc pages.
   - If an API call fails or the request/error is not understood, fetch the API directory page to locate the relevant API documentation:
     `https://help.aliyun.com/zh/dataworks/developer-reference/api-dataworks-public-2024-05-18-dir`
     Browse the category list, find the matching API name, and navigate to its detail page (URL pattern: `https://help.aliyun.com/zh/dataworks/developer-reference/api-dataworks-public-2024-05-18-{apinameincamelcase}`) for parameter details, error codes, and usage examples.
     For example, if `CreateNode` fails, find it under "数据开发（新版）" in the directory, then read its detail page: `https://help.aliyun.com/zh/dataworks/developer-reference/api-dataworks-public-2024-05-18-createnode`
3. **OpenAPI metadata** — fetch the raw JSON spec for exact parameter names, types, and required fields.
4. **SDK API docs** — check the typed SDK reference for correct method signatures and request classes.

- Java: `https://aliyunsdk-pages.alicdn.com/apidocs/{PRODUCT_CODE}/{API_VERSION}/java-async-tea/8.0.3/index.html`
- Node.js / Python: see `references/sources.md`

5. **GitHub source code** — read the Java SDK source for model/request class definitions: `https://github.com/aliyun/alibabacloud-java-sdk/tree/master/dataworks-public-20240518` (browse `src/main/java/com/aliyun/dataworks_public20240518/` for request/response models).
6. **MCP Server** — use the MCP Server to call APIs directly (see `references/mcp_server.md`).
7. **Browser** — use browser-use to visit the DataWorks Homepage (`https://dataworks.data.aliyun.com/${ALIBABA_CLOUD_REGION_ID}/#/index`) and inspect the UI behavior, network requests, or page content for clues.

## Credentials priority (must follow)

1. Environment variables: `ALIBABA_CLOUD_ACCESS_KEY_ID` / `ALIBABA_CLOUD_ACCESS_KEY_SECRET` / `ALIBABA_CLOUD_REGION_ID`
2. Credentials URI: `ALIBABA_CLOUD_CREDENTIALS_URI` (e.g. `http://localhost:7002/api/v1/credentials/0`). The SDK credentials provider automatically fetches and refreshes AK/SK/STS tokens from this HTTP endpoint.
3. Shared config file: `~/.alibabacloud/credentials`

Region policy: `ALIBABA_CLOUD_REGION_ID` is an optional default. If unset, decide the most reasonable region for the task; if unclear, ask the user.

## API discovery

Constants (use these values throughout):

- **PRODUCT_CODE**: `dataworks-public`
- **API_VERSION**: `2024-05-18`
- Use OpenAPI metadata endpoints to list APIs and get schemas (see references).

Do NOT rely on a hardcoded API list. Always discover APIs dynamically. Methods are listed in priority order — try them top-down:

### Method 1: Fetch from official help docs

Run the discovery script to curl the official documentation page and extract the complete API overview:

```bash
python scripts/fetch_api_overview.py
```

This fetches `https://help.aliyun.com/zh/dataworks/developer-reference/api-{PRODUCT_CODE}-{API_VERSION}-overview`, extracts the API list from `window.__ICE_PAGE_PROPS__.docDetailData.storeData.data.content`, and parses the HTML tables into a grouped API overview.

### Method 2: Fetch from OpenAPI metadata (full spec with parameters and responses)

Fetch raw API schemas and parameter definitions:

```bash
python scripts/list_openapi_meta_apis.py
```

This calls `https://next.api.aliyun.com/meta/v1/products/{PRODUCT_CODE}/versions/{API_VERSION}/api-docs.json` and outputs the full API docs JSON and a summary list.

To get the schema of a single API (replace `{ApiName}` with a name from the list above, e.g. `ListProjects`):

```
https://next.api.aliyun.com/meta/v1/products/{PRODUCT_CODE}/versions/{API_VERSION}/apis/{ApiName}/api.json
```

### Method 3: MCP Server tools (curated subset with category and parameter-position metadata)

If the MCP Server is running, use the MCP `tools/list` capability, or fetch `https://dataworks.data.aliyun.com/pop-mcp-tools` directly for the tool catalog JSON. Includes some APIs not in Method 2 (e.g. data service, permission approval).

## Calling APIs via SDK

**Recommend using the latest SDK version.** The DataWorks SDK is updated frequently with new APIs, bug fixes, and model changes. Check the latest version from the package registry before installing:

- Node.js: `https://www.npmjs.com/package/@alicloud/dataworks-public20240518`
- Python: `https://pypi.org/project/alibabacloud-dataworks-public20240518/`
- Java: `https://central.sonatype.com/artifact/com.aliyun/alibabacloud-dataworks_public20240518`

Prefer the official Alibaba Cloud SDK. Two styles are supported:

### Style 1: Generalized call (recommended, covers all APIs)

Use `@alicloud/openapi-client` to call any DataWorks API without importing product-specific SDK classes. This is the approach used by the MCP Server source code (`src/tools/callTool.ts`).

```bash
npm install @alicloud/openapi-client @alicloud/openapi-util @alicloud/tea-util @alicloud/credentials
```

```typescript
import OpenApi from "@alicloud/openapi-client";
import Util from "@alicloud/tea-util";

// 1. Create client
const config = new OpenApi.Config({
  accessKeyId: process.env.ALIBABA_CLOUD_ACCESS_KEY_ID,
  accessKeySecret: process.env.ALIBABA_CLOUD_ACCESS_KEY_SECRET,
  endpoint: `dataworks.${
    process.env.ALIBABA_CLOUD_REGION_ID || "cn-shanghai"
  }.aliyuncs.com`,
});
const client = new OpenApi.default(config);

// 2. Build request params (RPC style)
const params = new OpenApi.Params({
  style: "RPC",
  action: "ListProjects", // API name
  version: "{API_VERSION}", // see Constants above
  protocol: "HTTPS",
  method: "POST", // GET or POST per API spec
  authType: "AK",
  pathname: "/",
  bodyType: "json",
});

// 3. Build query/body from input
const query = { PageNumber: 1, PageSize: 10 };
const request = new OpenApi.OpenApiRequest({ query });
const runtime = new Util.RuntimeOptions({});

// 4. Call
const res = await client.callApi(params, request, runtime);
console.log(res.body);
```

Key rules from `src/tools/callTool.ts`:

- `style`: `'RPC'` when API has no path; `'ROA'` when it has a path.
- `method`: per API spec (`GET` / `POST` / `PUT` / `DELETE`).
- Parameters with `in: 'query'` go to `query`; `in: 'body'` / `in: 'formData'` go to `body`.
- For `GET` / `DELETE` requests, `body` must be `null` (otherwise signature fails).
- Use `bodyType: 'string'` to avoid precision loss on large numbers.

### Style 2: Product-specific SDK (typed, per-API methods)

```bash
npm install @alicloud/dataworks-public20240518
```

```typescript
import DataWorks from "@alicloud/dataworks-public20240518";
import * as DataWorksClasses from "@alicloud/dataworks-public20240518";
import OpenApi from "@alicloud/openapi-client";

const config = new OpenApi.Config({
  accessKeyId: process.env.ALIBABA_CLOUD_ACCESS_KEY_ID,
  accessKeySecret: process.env.ALIBABA_CLOUD_ACCESS_KEY_SECRET,
  endpoint: `dataworks.cn-shanghai.aliyuncs.com`,
});
const client = new DataWorks.default(config);

// Each API has a typed Request class and a method
const request = new DataWorksClasses.ListProjectsRequest({
  pageNumber: 1,
  pageSize: 10,
});
const runtime = new Util.RuntimeOptions({});
const resp = await client.listProjectsWithOptions(request, runtime);
```

API name → SDK method: `ListProjects` → `client.listProjectsWithOptions(request, runtime)`.

### Python SDK

```bash
pip install alibabacloud_dataworks_public20240518
```

```python
import os
from alibabacloud_dataworks_public20240518.client import Client
from alibabacloud_dataworks_public20240518 import models
from alibabacloud_tea_openapi.models import Config

config = Config(
    access_key_id=os.environ['ALIBABA_CLOUD_ACCESS_KEY_ID'],
    access_key_secret=os.environ['ALIBABA_CLOUD_ACCESS_KEY_SECRET'],
    endpoint=f"dataworks.{os.environ.get('ALIBABA_CLOUD_REGION_ID', 'cn-shanghai')}.aliyuncs.com",
)
client = Client(config)
request = models.ListProjectsRequest(page_number=1, page_size=10)
resp = client.list_projects(request)
print(resp.body)
```

### Java SDK

```xml
<dependency>
    <groupId>com.aliyun</groupId>
    <artifactId>alibabacloud-dataworks_public20240518</artifactId>
    <version>8.0.3</version>
</dependency>
```

```java
import com.aliyun.dataworks_public20240518.Client;
import com.aliyun.dataworks_public20240518.models.*;
import com.aliyun.teaopenapi.models.Config;

Config config = new Config()
    .setAccessKeyId(System.getenv("ALIBABA_CLOUD_ACCESS_KEY_ID"))
    .setAccessKeySecret(System.getenv("ALIBABA_CLOUD_ACCESS_KEY_SECRET"))
    .setEndpoint("dataworks." + System.getenv("ALIBABA_CLOUD_REGION_ID") + ".aliyuncs.com");
Client client = new Client(config);

ListProjectsRequest request = new ListProjectsRequest()
    .setPageNumber(1L)
    .setPageSize(10L);
ListProjectsResponse resp = client.listProjects(request);
System.out.println(resp.getBody());
```

Java SDK API docs: `https://aliyunsdk-pages.alicdn.com/apidocs/{PRODUCT_CODE}/{API_VERSION}/java-async-tea/8.0.3/index.html`

## MCP Server integration (last resort)

Only use MCP when SDK calls keep failing after consulting docs, metadata, and GitHub source:

```bash
npm install -g alibabacloud-dataworks-mcp-server
```

See `references/mcp_server.md` for full configuration.

## API categories

| Category         | Description                                                               | Example APIs                                                                 |
| ---------------- | ------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
| 认证文件管理     | Certificate management                                                    | `Import/Get/List/DeleteCertificate`                                          |
| 空间管理         | Workspace, roles, members                                                 | `*Project`, `*ProjectMember`, `*ProjectRole`                                 |
| 数据源           | Data source CRUD and connectivity test                                    | `*DataSource`, `*DataSourceSharedRule`                                       |
| 计算资源         | Compute resource management                                               | `*ComputeResource`                                                           |
| 资源组管理       | Resource groups, routes, networks                                         | `*ResourceGroup`, `*Route`, `*Network`                                       |
| 数据开发（新版） | Nodes, workflows, resources, functions, pipelines                         | `*Node`, `*WorkflowDefinition`, `*Resource`, `*Function`, `*PipelineRun`     |
| 数据集成         | DI sync jobs and alarm rules                                              | `*DIJob`, `*DIAlarmRule`                                                     |
| 数据地图         | Catalogs, databases, tables, columns, lineage, datasets, meta collections | `*Catalog`, `*Table`, `*Column`, `*Lineage*`, `*Dataset*`, `*MetaCollection` |
| 运维中心         | Alerts, tasks, task instances, workflows, workflow instances              | `*AlertRule`, `*Task`, `*TaskInstance*`, `*Workflow`, `*WorkflowInstance*`   |
| 数据质量         | Quality templates, scans, alert rules, scan runs                          | `*DataQualityTemplate`, `*DataQualityScan`, `*DataQualityAlertRule`          |
| 安全中心         | Identity credentials                                                      | `CreateIdentifyCredential`                                                   |
| 标签管理         | Data asset tags                                                           | `*DataAssetTag`, `TagDataAssets`, `UnTagDataAssets`                          |
| 开放平台         | Async job status                                                          | `GetJobStatus`                                                               |

Use dynamic discovery (above) to get the full list and parameter schemas. Common naming patterns:

1. Inventory/list: prefer `List*` / `Get*` / `Describe*` APIs.
2. Create/configure: prefer `Create*` / `Update*` / `Import*` APIs.
3. Remove: prefer `Delete*` / `Remove*` APIs.
4. Lifecycle: prefer `Start*` / `Stop*` / `Suspend*` / `Resume*` / `Rerun*` APIs.

## Destructive operation policy

Before executing delete, stop, or suspend operations, always summarize the affected resources and confirm with the user.

## Timestamp handling

DataWorks APIs use millisecond timestamps. Convert between human-readable dates and timestamps as needed.

## Selection questions (ask when unclear)

1. Which DataWorks project (project ID or name)?
2. Which region? (common: `cn-shanghai`, `cn-beijing`, `cn-hangzhou`, `cn-shenzhen`)
3. What type of operation? (data development / operations / data quality / metadata / workspace)
4. For task operations: target node ID, workflow, or instance ID?

## References

- **Cookbook (verified patterns & pitfalls)**: `references/cookbook.md` — FlowSpec structure for CreateNode, submit-and-deploy flow, data quality rules, bizdate format, response parsing, and FAQ from real-world usage.
- MCP Server integration: `references/mcp_server.md`
- Sources: `references/sources.md`


---
Source attribution: aliyun
Original project: https://github.com/aliyun/alibabacloud-bigdata-skills/blob/e922518d0d66c7a4b84f2951283c2985727fac19/skills/dataworks/open-api/SKILL.md
License: Apache-2.0
License information: https://www.apache.org/licenses/LICENSE-2.0
Original upstream instructions; downloaded from Mega AI Hub.

## Upstream license notice

                                 Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

      "Licensor" shall mean the copyright owner or entity authorized by
      the copyright owner that is granting the License.

      "Legal Entity" shall mean the union of the acting entity and all
      other entities that control, are controlled by, or are under common
      control with that entity. For the purposes of this definition,
      "control" means (i) the power, direct or indirect, to cause the
      direction or management of such entity, whether by contract or
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
      outstanding shares, or (iii) beneficial ownership of such entity.

      "You" (or "Your") shall mean an individual or Legal Entity
      exercising permissions granted by this License.

      "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.

      "Object" form shall mean any form resulting from mechanical
      transformation or translation of a Source form, including but
      not limited to compiled object code, generated documentation,
      and conversions to other media types.

      "Work" shall mean the work of authorship, whether in Source or
      Object form, made available under the License, as indicated by a
      copyright notice that is included in or attached to the work
      (an example is provided in the Appendix below).

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally
      submitted to Licensor for inclusion in the Work by the copyright owner
      or by an individual or Legal Entity authorized to submit on behalf of
      the copyright owner. For the purposes of this definition, "submitted"
      means any form of electronic, verbal, or written communication sent
      to the Licensor or its representatives, including but not limited to
      communication on electronic mailing lists, source code control systems,
      and issue tracking systems that are managed by, or on behalf of, the
      Licensor for the purpose of discussing and improving the Work, but
      excluding communication that is conspicuously marked or otherwise
      designated in writing by the copyright owner as "Not a Contribution."

      "Contributor" shall mean Licensor and any individual or Legal Entity
      on behalf of whom a Contribution has been received by Licensor and
      subsequently incorporated within the Work.

   2. Grant of Copyright License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      copyright license to reproduce, prepare Derivative Works of,
      publicly display, publicly perform, sublicense, and distribute the
      Work and such Derivative Works in Source or Object form.

   3. Grant of Patent License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      (except as stated in this section) patent license to make, have made,
      use, offer to sell, sell, import, and otherwise transfer the Work,
      where such license applies only to those patent claims licensable
      by such Contributor that are necessarily infringed by their
      Contribution(s) alone or by combination of their Contribution(s)
      with the Work to which such Contribution(s) was submitted. If You
      institute patent litigation against any entity (including a
      cross-claim or counterclaim in a lawsuit) alleging that the Work
      or a Contribution incorporated within the Work constitutes direct
      or contributory patent infringement, then any patent licenses
      granted to You under this License for that Work shall terminate
      as of the date such litigation is filed.

   4. Redistribution. You may reproduce and distribute copies of the
      Work or Derivative Works thereof in any medium, with or without
      modifications, and in Source or Object form, provided that You
      meet the following conditions:

      (a) You must give any other recipients of the Work or
          Derivative Works a copy of this License; and

      (b) You must cause any modified files to carry prominent notices
          stating that You changed the files; and

      (c) You must retain, in the Source form of any Derivative Works
          that You distribute, all copyright, patent, trademark, and
          attribution notices from the Source form of the Work,
          excluding those notices that do not pertain to any part of
          the Derivative Works; and

      (d) If the Work includes a "NOTICE" text file as part of its
          distribution, then any Derivative Works that You distribute must
          include a readable copy of the attribution notices contained
          within such NOTICE file, excluding those notices that do not
          pertain to any part of the Derivative Works, in at least one
          of the following places: within a NOTICE text file distributed
          as part of the Derivative Works; within the Source form or
          documentation, if provided along with the Derivative Works; or,
          within a display generated by the Derivative Works, if and
          wherever such third-party notices normally appear. The contents
          of the NOTICE file are for informational purposes only and
          do not modify the License. You may add Your own attribution
          notices within Derivative Works that You distribute, alongside
          or as an addendum to the NOTICE text from the Work, provided
          that such additional attribution notices cannot be construed
          as modifying the License.

      You may add Your own copyright statement to Your modifications and
      may provide additional or different license terms and conditions
      for use, reproduction, or distribution of Your modifications, or
      for any such Derivative Works as a whole, provided Your use,
      reproduction, and distribution of the Work otherwise complies with
      the conditions stated in this License.

   5. Submission of Contributions. Unless You explicitly state otherwise,
      any Contribution intentionally submitted for inclusion in the Work
      by You to the Licensor shall be under the terms and conditions of
      this License, without any additional terms or conditions.
      Notwithstanding the above, nothing herein shall supersede or modify
      the terms of any separate license agreement you may have executed
      with Licensor regarding such Contributions.

   6. Trademarks. This License does not grant permission to use the trade
      names, trademarks, service marks, or product names of the Licensor,
      except as required for reasonable and customary use in describing the
      origin of the Work and reproducing the content of the NOTICE file.

   7. Disclaimer of Warranty. Unless required by applicable law or
      agreed to in writing, Licensor provides the Work (and each
      Contributor provides its Contributions) on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
      implied, including, without limitation, any warranties or conditions
      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
      PARTICULAR PURPOSE. You are solely responsible for determining the
      appropriateness of using or redistributing the Work and assume any
      risks associated with Your exercise of permissions under this License.

   8. Limitation of Liability. In no event and under no legal theory,
      whether in tort (including negligence), contract, or otherwise,
      unless required by applicable law (such as deliberate and grossly
      negligent acts) or agreed to in writing, shall any Contributor be
      liable to You for damages, including any direct, indirect, special,
      incidental, or consequential damages of any character arising as a
      result of this License or out of the use or inability to use the
      Work (including but not limited to damages for loss of goodwill,
      work stoppage, computer failure or malfunction, or any and all
      other commercial damages or losses), even if such Contributor
      has been advised of the possibility of such damages.

   9. Accepting Warranty or Additional Liability. While redistributing
      the Work or Derivative Works thereof, You may choose to offer,
      and charge a fee for, acceptance of support, warranty, indemnity,
      or other liability obligations and/or rights consistent with this
      License. However, in accepting such obligations, You may act only
      on Your own behalf and on Your sole responsibility, not on behalf
      of any other Contributor, and only if You agree to indemnify,
      defend, and hold each Contributor harmless for any liability
      incurred by, or claims asserted against, such Contributor by reason
      of your accepting any such warranty or additional liability.

   END OF TERMS AND CONDITIONS

   APPENDIX: How to apply the Apache License to your work.

      To apply the Apache License to your work, attach the following
      boilerplate notice, with the fields enclosed by brackets "[]"
      replaced with your own identifying information. (Don't include
      the brackets!)  The text should be enclosed in the appropriate
      comment syntax for the file format. We also recommend that a
      file or class name and description of purpose be included on the
      same "printed page" as the copyright notice for easier
      identification within third-party archives.

   Copyright [yyyy] [name of copyright owner]

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.



# Mega AI Hub resource metadata

Creator / publisher: aliyun
Original project: https://github.com/aliyun/alibabacloud-bigdata-skills/blob/e922518d0d66c7a4b84f2951283c2985727fac19/skills/dataworks/open-api/SKILL.md
Attribution basis: Source repository record

Fields of work: Development & Engineering
Roles: Backend Developer, Data Engineer, ML / AI Engineer
Specialties: API, Backend, Database, DevOps, Word Documents, Frontend, Git, Playwright, Testing
Tools: Alibaba Cloud
Country applicability: Country not specified
Classification basis: Source catalog labels
Instruction SHA-256: 674ec9107d1b752fc8ec043ce2e76acbea0dae99e75aa76824ddbbe8f986aea9
